【问题标题】:Fatal error: Uncaught exception 'Exception' with message '1048致命错误:未捕获的异常“异常”和消息“1048”
【发布时间】:2014-10-30 20:28:46
【问题描述】:

所以我想在我的数据库中插入一个新用户,但是当我想发布我的注册时,会弹出这个错误:

Fatal error: Uncaught exception 'Exception' with message '1048' in 
C:\xampp\htdocs\Zephryte\app\classes\users.class.php:110 Stack trace: #0 
C:\xampp\htdocs\Zephryte\index.php(5): users->register() #1 {main} thrown in 
C:\xampp\htdocs\Zephryte\app\classes\users.class.php on line 110

我知道这来自我的 MySQLi 连接,但我不知道这意味着什么或如何处理它......

这是产生错误的代码:

$query->bind_param('ssssssssssssssssssssss', $data, $_POST['username'], $_POST['password'], $een, $_POST['email'], $code, $ipAddress, $ipAddress, $data, $data, $een, $null, $null, $nul, $nul, $een, $een, $nul, $_POST['skype'], $nul, $nul, $null); //106

$query->execute(); //107

if (!$query->execute()) //108

{ //109

    throw new Exception($this->db->conn->errno, 1); //110

} //111

$query->close(); //112

你们中有人知道错误是什么,以及如何解决吗?

谢谢。

【问题讨论】:

标签: php mysqli


【解决方案1】:

您的查询失败,因为您错过了其中一列。

我不能说缺少哪个,但是

http://php.net/manual/en/mysqli.error.php

将提供更多信息

【讨论】:

    【解决方案2】:

    mysql 文档显示该错误可能是一个空列。 http://www.mysqlfaqs.net/mysql-faqs/Errors/1048-Column-cannot-be-null

    异常中的数字是mysql errno,这是他的关键。您所要做的就是谷歌mysql 1048 来查找mysql 错误文档。

    【讨论】:

      猜你喜欢
      • 2015-01-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-07-09
      • 1970-01-01
      • 2014-08-26
      • 1970-01-01
      相关资源
      最近更新 更多