How do I update MySQL row in PHP?

前端 未结 3 1939
余生分开走
余生分开走 2021-01-24 20:49

I have a MySQL database that I\'m working with, but when I try to update a row in it, it doesn\'t work. Here\'s the update code I\'m working with:

mysql_query(\"         


        
3条回答
  •  無奈伤痛
    2021-01-24 21:46

    your syntax is correct, so it might be an error with the variables or your field names.

    Try this:

    $sql = "UPDATE offtopic SET next = '$insert' WHERE id = '$id'";
    if (!mysql_query($sql)) {
        echo "MySQL Error: " . mysql_error() . "
    " . $sql; }

    That might show you some useful information to help you debug.

提交回复
热议问题