douzheng9221
2016-06-26 16:17
浏览 631
已采纳

SQLSTATE [HY000]:常规错误:1366整数值不正确:任何解决方案?

I'm sorry, but i have a problem on my website when i want to create any account. My error is :

Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY000]: General error: 1366 Incorrect integer value: '' for column 'guid' at row 1'

And my code is :

$db->query('INSERT INTO accounts (guid, account, pass, level, vip, email, lastIP, question, reponse, pseudo) VALUES ("", "'.$account.'", "'.$pass1.'", "0", "0", "'.$mail.'", "'.$ip.'", "'.$question.'", "'.$reponse.'", "'.$pseudo.'")');

Please help me... Thank you so much, Stackoverflowers :D !

图片转代码服务由CSDN问答提供 功能建议

对不起,我想在创建任何帐户时在我的网站上出现问题。 我的错误 是:

致命错误:未捕获异常'PDOException',消息'SQLSTATE [HY000]:常规错误:1366错误的整数值:''列''guid'at 第1行

我的代码是:

  $ db-> query('INSERT INTO accounts  (guid,account,pass,level,vip,email,lastIP,question,reponse,pseudo)VALUES(“”,“'。$ account。'”,“'。$ pass1。'”,“0”,“0  “,”'。$ mail。'“,”'。$ ip。'“,”'。$ question。'“,”'。$ reponse。'“,”'。$ pseudo。'“)');  
   
 
 

请帮助我......非常感谢,Stackoverflowers:D!

  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

1条回答 默认 最新

  • duandi8613 2016-06-26 16:22
    最佳回答

    You are trying to insert an empty string into a column that is expecting an integer. You should probably be inserting an integer. Depending on the setup, you might get away with just inserting a 0 or something but since the column is called guid, that would probably break something. Another option would be to omit it entirely and see if it is set automatically.

    $db->query('INSERT INTO accounts (account, pass, level, vip, email, lastIP, question, reponse, pseudo) VALUES ("'.$account.'", "'.$pass1.'", "0", "0", "'.$mail.'", "'.$ip.'", "'.$question.'", "'.$reponse.'", "'.$pseudo.'")');
    
    评论
    解决 无用
    打赏 举报

相关推荐 更多相似问题