解析错误:语法错误,意外')'

时间:2015-08-07 03:44:54

标签: php mysqli phpmyadmin

if (isset($_POST)){
    if ($_POST['isAdd'] == 'true') {
        $Officer = $_POST['Officer'];
        $Desk = $_POST['Desk'];
        $Food = $_POST['Food'];
        $Amount = $_POST['Amount'];

        $sql  = "INSERT INTO orderTABLE (`id` , `Officer` ,`Desk`, `Food`,`Amount`) VALUES (NULL, 'Officer', 'Desk', 'Food','Amount')");
        mysqli_query($con,$sql);

    }
}

1 个答案:

答案 0 :(得分:2)

)查询

的末尾删除括号INSERT
$sql  = "INSERT INTO orderTABLE (`id` , `Officer` ,`Desk`, `Food`,`Amount`) VALUES (NULL, 'Officer', 'Desk', 'Food','Amount')");

应该是

$sql  = "INSERT INTO orderTABLE (`id` , `Officer` ,`Desk`, `Food`,`Amount`) VALUES (NULL, 'Officer', 'Desk', 'Food','Amount')";