I’ve been working in Zend Framework for over a year now, but I’ve never encountered this issue.
I am developing on my local machine running PHP 5.2, Zend Framework 1.11.4, and MySQL 5. This is all running off Apache 2 on Ubuntu 10.04
My code is trying to add a permission record to the database. Here is my code:
protected function _add($resource, $description)
{
$this->_sql = 'INSERT INTO Permissions (id, resource, description)
VALUES (NULL, :resource, :description)';
$this->_params = array(
':resource' => $resource,
':description' => $description
);
$this->_query = $this->_db->prepare($this->_sql);
$this->_query->execute($this->_params);
$this->_result = $this->_query->fetchAll();
if(count($this->_result) != 1) {
return false;
}
return $this->_result[0];
}
The exception throw is happening on the line “$this->_result = $this->_query->fetchAll();” and the message coming back is just “SQLSTATE[HY000]: General error”. Thats it. No error number or anything. Just GENERAL ERROR.
HOWEVER, when I check the Permissions table, the record has been successfully added. WTF?
I’ve been googling around for answers but I have found nothing that fixes the issue.
Any ideas?
instead of
I should have spotted that one earlier.