1.If you use INSERT into table VALUES ... without the list of column,all the values of each column should be in the list of VALUES().2."INSERT INTO ".$sql_art." VALUES...."3.values('','$name','$author','$content','$lid','$time','$visit','$good','$upall','$news','$newsurl','$html','$ubb','$time') is ok when all the variables are in char type.
估计问题在这里的$sql_art上,换成你的表名,试一下。如果换成表名可以,这样替代$sql_art
`$sql_art`
那么检查
mysql_query("INSERT INTO admin VALUES (1, '$user', '$pw', '1')");
mysql_query("INSERT INTO admin VALUES ('', '$user', '$pw', '1')");
是否能通过
我猜问题是你的变量里面比如$author可能内容里面包含了单引号
所以导致不合法的sql语句,不知道有没有蒙对?
后一个: VALUES ('',
字段类型不匹配!一般在双引号字符串中用变量比如"My name is $name!",
最好是写成"My name is {$name}!"明确的告诉PHP,我的花括号中是变量!
echo $sql_str;楼主把这个sql语句echo出来然后在数据库里执行一下不就知道了嘛?!