sql语法错误让我查一下mariadb服务器的手册

drnojrws  于 2021-06-18  发布在  Mysql
关注(0)|答案(1)|浏览(417)

我得到的错误是
插入记录时出错sql语法有错误;检查与您的mariadb服务器版本相对应的手册,以了解在第1行“arcade”,123)“附近使用的正确语法”

if (isset($_POST['name'])) {

    //code to insert new record into DB
    $insQuery = "insert into inventory values(NULL,"
    ."'". $_POST['name'] ."',"
    . $_POST['price'] .","
    . $_POST['rating'] .","
    . $_POST['console'] .","
    ."'". $_POST['genre'] ."',"
    . $_POST['quantity'] .")";
0sgqnhkj

0sgqnhkj1#

if(isset($\u post['name'])){

//code to insert new record into DB
$insQuery = "insert into inventory(name, price,rating, console,gender,quantity) values(NULL, '". $_POST['name'] ."','"
. $_POST['price'] ."','"
. $_POST['rating'] ."','"
. $_POST['console'] ."','"
."','". $_POST['genre'] ."','"
. $_POST['quantity'] ."')";

你忘记了一些逗号(,)和'在你的查询,也忘记了表字段名称在库存(名称,价格,评级,控制台,性别,数量)。。。。把它放在表字段名那里。。。

相关问题