2014-11-01 137 views
-1

因此,我忙于重写我的注册功能。而suddently,我得到这个错误:致命错误:未收集异常'异常'与消息'1064'

Fatal error: Uncaught exception 'Exception' with message '1064' in C:\xampp\htdocs\Zephryte\app\classes\users.class.php:123 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 123 

唯一的一点是,我不知道什么是1064是...有一个名单菱与这些代码及其含义在互联网上?我还会提供一些我的代码:

$query = $this->db->conn->prepare("INSERT INTO ht_users VALUES ('', ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?");//120 
    if($this->db->conn->errno)//121 
    {//122 
     throw new Exception($this->db->conn->errno);//123 
    }//124 

我是否犯过任何真正的简单错误?我没有看到树林里的森林吗?

回答

1

你缺少一个右括号:

$query = $this->db->conn->prepare 
("INSERT INTO ht_users VALUES 
('', ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");//120 
                    ^that one 
0

这取决于您正在使用的数据库系统,但这可能是数据库中的错误代码,您通常可以在网上查找它们的含义,但查看数据库的日志文件可能更容易。

+0

ETA:你不是在查询关闭“)”,这是最有可能的问题。 – AlpineCoder 2014-11-01 01:56:42

0

如果您的系统使用MySQL,则消息'1064'表示“SQL语法错误”。

相关问题