我得到的错误是
插入记录时出错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'] .")";
1条答案
按热度按时间0sgqnhkj1#
if(isset($\u post['name'])){
你忘记了一些逗号(,)和'在你的查询,也忘记了表字段名称在库存(名称,价格,评级,控制台,性别,数量)。。。。把它放在表字段名那里。。。