I get error when i try list users in Zend Framework 1:
Primary key column(s) (id) are not columns in this table ()"
Controller :
public function listAction(){
$mapper = new Application_Model_UserMapper();
$users = $mapper->fetchAll();
Mapper :
public function fetchAll($where=null)
{
$resultSet = $this->getDbTable()->fetchAll($where);
return $resultSet;
dbtable
class Application_Model_DbTable_User extends Zend_Db_Table_Abstract {
protected $name = 'users';
protected $_primary ='id';
}
Model
class Application_Model_User {
protected $_id;
protected $_useremail;
protected $_usergroup;
protected $_password;
protected $_password_salt;
Sql :
CREATE TABLE users (
id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
useremail VARCHAR(50) UNIQUE NOT NULL,
password VARCHAR(32) NULL,
password_salt VARCHAR(32) NULL,
usergroup VARCHAR(12) NULL,
real_name VARCHAR(150) NULL
);
CREATE INDEX "idUser" ON "users" ("useremail");