我有以下代码更新数据库表中的字段以向其添加 1。ID 应该有一个发布到它的变量。谁能看到这是哪里出错了?
编辑:对不起,我完全忘记提及实际问题。数据库未更新该字段。
<?php
$con=mysqli_connect("localhost","**","***","***");
// Check connection
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
mysqli_query($con,"UPDATE base SET thumbdown = thumbdown + 1 WHERE id = $_POST['id']");
mysqli_close($con);
?>