我想在记录不存在时写一个更新命令。发消息后
mysqli_query($connection,"UPDATE system SET count ='1' where code ='929'");
我的意思是,如果有一个929代码的记录字段更新信息,否则给出消息
答案 0 :(得分:1)
试试这个:
$num_modified = mysqli_query($connection,"UPDATE system SET count ='1' where code ='929'");
if ($num_modified != 1) {
echo "Failed to modify!";
}