ZF-7889: Zend_Auth_Adapter_DbTable SQL incompatible with MS SQL Server ZF 1.9

Issue Type: Bug Created: 2009-09-18T09:35:07.000+0000 Last Updated: 2010-06-18T15:49:18.000+0000 Status: Resolved Fix version(s): Reporter: Euller (eullerbd) Assignee: Ralph Schindler (ralph) Tags: - Zend_Auth

Related issues: Attachments:


This list states that the problem has been solved, but I continue having problems on accessing the database Sql Server using Zend_Auth. You have the implementation and Exception below.

I would like quoting that the fields on table are correct, I tested them using the database mysql.

  • Exception
  • The supplied parameters to Zend_Auth_Adapter_DbTable failed to produce a valid sql statement, please check table and column names for validity.
  • Implementation
<pre class="highlight">
$authAdapter = new Zend_Auth_Adapter_DbTable (Zend_Registry::get ( 'database' ), 'user', 'email', 'password', 'SHA1' );
$authAdapter->setIdentity ( '' . $login . '' )->setCredential ( '' . $senha . '' );
$auth = self::getInstance ();
$result = $auth->authenticate ( $authAdapter );
if ($result->isValid ()) { 
$data = $authAdapter->getResultRowObject ( null, 'password' ); 
$auth->getStorage ()->write ( $data ); 
$auth->getIdentity (); 



Posted by Ralph Schindler (ralph) on 2009-10-09T07:01:16.000+0000

Try changing:

<pre class="highlight">
$authAdapter = new Zend_Auth_Adapter_DbTable (Zend_Registry::get ( 'database' ), 'user', 'email', 'password', 'SHA1' );


<pre class="highlight">
$authAdapter = new Zend_Auth_Adapter_DbTable (Zend_Registry::get ( 'database' ), 'user', 'email', 'password', 'SHA1(?)' );

Posted by Ralph Schindler (ralph) on 2010-06-18T15:49:18.000+0000

Fix to user's code was supplied

Have you found an issue?

See the Overview section for more details.


© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.