我是新手,还在学习php。我试图运行一些mysqli_query但它给了我一些错误。我的代码如下所示。
<?php
ob_start();
include("db.php");
$result = mysqli_query($conn,"SELECT * FROM contest");
while($row = $result->fetch_assoc()){
if($row['automated'] ==1){
echo 'Atomatic is enabled';
$result1 = mysqli_query($conn,"UPDATE `contest` SET automated =0"
$new = mysqli_query($conn,$result1);
echo 'Atomatic is Disabled';
}
else{
echo 'Atomatic is Disabled';
}
}
可以有人检查,请在这个查询中建议我有什么不对吗?它给我一些错误,如解析错误:语法错误,意外'$ new',如果我改变它就类似。感谢
答案 0 :(得分:1)
关闭专利。()
..
$result1 = mysqli_query($conn,"UPDATE `contest` SET automated =0");//error was here