日期:2014-11-26 分类:网络技术 浏览:9953 来源:邦明科技
用echo $sql;输出SQL语句,下面代码没错,但就是无法执行也没报错:
insert into xmoa_customer (customerid,contactname,gender,company,birthday,country,staff,staffusername,sortpath,customertype,customerfrom,customerstate,website,address,qqmsn,zipcode,mobile,email,telephone,fax,account,bank,accountname,beizhu,addtime,level,customerlevel,addyear,addmonth) values ('customerlevel','customerlevel','男士','customerlevel','2014-09-28','customerlevel','符工','info@bmkj.net','0,1,','银牌客户','网络广告','潜在客户','','','','','','','','','','','','','2014-09-28 11:46:42','2147483647','30','2014','9')
原因是某个字段,如:password不能为空,却在SQL语句没有赋值
使用:
$result=mysql_query($sql) or die( mysql_error() );
发现原因是:Field 'password' doesn't have a default value
PHP INSERT语句没执行也没报错的解决方法:给该字段password赋值或者修改该段允许为空。