MySql查询无法正常工作

时间:2016-03-06 17:15:12

标签: php mysql

此查询有什么问题?

$ a- $ o是正常的,回声工作

$query = "INSERT INTO `Zakazes` (
`id`, `dateDelivery`, `timeCok`, `nameClient`, `phoneClient`, `metro`,
 `adress`, `comments`, `product`, `summ`, `skidka`, `result`, `cupon`, 
`cuponPin`, `cuponBron`, `timeDelivery`) VALUES (\'NULL\', \'$a\', \'$b\',
 \'$c\', \'$d\', \'$e\', \'$f\', \'$g\', \'$h\', \'$i\', \'$j\', \'$k\',
 \'$l\', \'$m\', \'$n\', \'$o\');";

1 个答案:

答案 0 :(得分:-1)

表格列无需'',需要将其插入表格列中,这是必需的。

之间,删除;之后的)

正确的代码应如下所示:

  $query = "INSERT INTO Zakazes(
    id, dateDelivery, timeCok, nameClient, phoneClient, metro,
     adress, comments, product, summ, skidka, result, cupon, 
    cuponPin, cuponBron, timeDelivery) VALUES ('NULL', '$a', '$b',
     '$c', '$d', '$e', '$f', '$g', '$h', '$i', '$j', '$k',
     '$l', '$m', '$n', '$o')";
相关问题