INSERT INTO reports (type,title,body,dateposted,condition) VALUES ('avatar','test1','test1',NOW(),'0');
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'condition) VALUES ('avatar','test1','test1',NOW(),'0')' at line 1

解决方案 »

  1.   

    condition 这个字段是字符串型?可以试试看:INSERT INTO reports (type,title,body,dateposted,condition) VALUES ('"avatar"','"test1"','"test1"',NOW(),'"0"'); 
      

  2.   

    呵呵,找到问题了字段名不能用type和condition,我把type字段名改成typs,condition改成conditions就OK了,另外我最后也犯了个错,conditions类型我用的是TINGINT,我VALUE的值是'0',这样就变成字符类型了,去掉''即可,谢谢大家的回复,本人新手一个,呵呵~低级错误让人头疼