Hello folks,
Good day to all I am relatively beginner in Zend and I have such a problem:
After login to my app I have this error message:
Exception information:
Message: The supplied parameters to Zend_Auth_Adapter_DbTable failed to produce a valid sql statement, please check table and column names for validity.
public function loginAction()
{
$f = new Application_Form_Logowanie();
if ($f->isValid($_POST)) {
$login = $f->getValue("login");
$password = $f->getValue("password");
$auth = Zend_Auth::getInstance();
$authAdapter = new Zend_Auth_Adapter_DbTable(
Zend_Db_Table::getDefaultAdapter(),
"users",
"email",
"md5",
"SHA1(CONCAT('" .Zend_Registry::get('salt'). "', ?, salt))");
$authAdapter->setIdentity($login);
$authAdapter->setCredential($password);
$authResult = $auth->authenticate($authAdapter);
if ($authResult->isValid()) {
$auth->getStorage()->write($authAdapter->getResultRowObject(null, 'md5'));
$this->view->sukces = "Fajnie udało się zalogować";
return;
}
$this->view->error = true;
}
$this->view->form = $f;
}
The connection seems to be fine in the application.ini I have:
resources.db.isDefaultTableAdapter = true
My table structure:
CREATE TABLE IF NOT EXISTS `users` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(64) DEFAULT NULL,
`surname` varchar(64) DEFAULT NULL,
`email` varchar(128) DEFAULT NULL,
`pubdate` date DEFAULT NULL,
`phone` varchar(128) DEFAULT NULL,
`md5` varchar(40) DEFAULT NULL,
`firm` varchar(128) DEFAULT NULL,
`position` varchar(128) DEFAULT NULL,
`birthdate` date DEFAULT '0000-00-00',
`birthplace` varchar(128) DEFAULT NULL,
`id_invoice` int(11) unsigned DEFAULT NULL,
`added_group` int(1) unsigned zerofill DEFAULT '0',
`salt` varchar(50) DEFAULT NULL,
`nick` varchar(128) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `email` (`email`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=latin2 AUTO_INCREMENT=1425 ;