我收到以下错误,当我提交表单:SQL错误 - 不正确的整数值
Can't added a new post. Incorrect integer value: '' for column 'aid' at row 1
PHP代码:
$insert = mysql_query("INSERT INTO brt_articles VALUES('', '$post_title', '$des',
'$date', '$org_date')");
if($insert)
{
echo "<font color=green>Successfully added a new article.</font>";
header("Refresh:3; url=allbrtarticle.php");
}
else
{
echo "<font color=red>Can't added a new post</font>" .
mysql_error();
}
在我的本地也没关系。但在服务器为什么它给我一个错误消息?
列'aid'的类型是什么? – 2013-02-25 04:30:52
在数据库表中将'aid'改为'autoincrement'会解决这个问题。 – 2013-02-25 04:31:20
那么,@马丹萨波塔,我正在检查它.. – 2013-02-25 04:32:14