首頁  >  問答  >  主體

mysqli更新不了數據

$sql="UPDATE 'student' SET 'course'='javascript','grade'=88,'WHERE 'id'=3";運行後提示;連線成功更新失敗You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''student' SET 'name'='小明','course'='javascript','grade'=88, 'create_tim' at line 1

rapturerapture1715 天前1339

全部回覆(5)我來回復

  • rapture

    rapture2020-02-13 09:18:57

    好的,謝謝您

    回覆
    0
  • 小可耐

    小可耐2020-02-12 12:28:53

    打錯了,會提示對應的sql

    回覆
    0
  • 小可耐

    小可耐2020-02-12 12:28:21

    咱的看不懂你打的是什麼,你自己在web資料庫線上管理裡修改一下,然後會提示相信的sql語句

    回覆
    0
  • 天蓬老师

    天蓬老师2020-02-08 12:02:00

    欄位, 表名要用反引號, 而不是單引號...反引號在ESC鍵下面

    回覆
    1
  • rapture

    $sql="UPDATE `student`, SET `course`=`javascript`,`grade`=88,WHERE `id`=3";我換成ESC按鍵下面的反引號了,還有出錯 錯誤提示:更新失敗You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SET `course`=`javascript`,`grade`=88,WHERE `id `=3' at line 1

    rapture · 2020-02-10 14:37:03
  • 取消回覆