MySQL Query Error
insert into users (`u_id`,`username`,`password`,`email`,`question`,`answer`,`status`,`handset`,`reg_time`,`reg_ip`) values('','wang','b1a2109ee710a8b9','[email protected]','','','123456789123456789','2532654','1272426436','127.0.0.1') 
1364 Field 'current_money' doesn't have a default value
帮我看一下这个是什么问题,谢谢!!!

解决方案 »

  1.   

    current_money,要写出这个字段。。要给一个默认值。一个占位符insert into users (`u_id`,current_money,`username`,`password`,`email`,`question`,`answer`,`status`,`handset`,`reg_time`,`reg_ip`) values('',0,'wang','b1a2109ee710a8b9','[email protected]','','','123456789123456789','2532654','1272426436','127.0.0.1')  
      

  2.   

    是的,你在定义表时,这个字段时加了NOT NULL,也就是这个字段不能为空。
    解决办法
    1。 修改表这个字段的定义,加上default,如default 0, default '',default NULL等,、
    或2。在插入表时必须指定这个字段的内容。
      

  3.   

    楼上几位说得都很好了“Field 'current_money' doesn't have a default value”这是一句英文大白话啊,在线翻译一下就该明白了啊。
      

  4.   

    uid 估计是 自增型,主键,你赋空值,怎能成功??
      

  5.   

    这个问题,好像还和配置文件有关系!!!php+mysql的
      

  6.   

    SQL语句没有这个'current_money' 字段啊