2013-12-10 36 views
0

我正在使用PHP 5.3,我想从一个html表单插入数据到数据库中。没有错误想到这一个:0给出的参数

PHP的警告:mysqli_error()期望的是1个参数,0给出

这是我的查询:

$con->query("INSERT INTO anime ('original_title', 'japan_title', english_title', 'studio', 'season', 'year', 'state', 'type', 'description', 'created',) 
VALUES 
('$otitle', '$jtitle', '$etitle', '$studio', '$season', '$year', '$status', '$type', '$des', '$created')") or die(mysqli_error()); 
+3

错误消息非常具体:您应该在调用'mysqli_error()'时提供一个参数,并且你没有这样做(参见你的文章中的'或die(mysqli_error());')。什么部分不清楚? –

+0

您可能想要将mysqli_error()更改为$ con> error – Kickstart

回答

0

你必须支付额外的逗号插入行的末尾,这意味着插入查询需要另一个未出现在值中的字段(第1行):

, 'state', 'type', 'description', 'created',) 

大概意思是:

, 'state', 'type', 'description', 'created') 

----------------------------------- ----------------------------------^

相关问题