【发布时间】: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
你们中有人知道错误是什么,以及如何解决吗?
谢谢。
【问题讨论】:
-
什么是
$nul、$null、$een,以及您在其中获得的其他变量?那些 all 设置正确吗? -
根据文档:
1048: Column cannot be null...。您的一列似乎是NULL。 -
将
throw new Exception($this->db->conn->errno, 1);替换为die($query->error);。这应该会给你一些更有用的东西。