The supplied parameters to Zend_Auth_Adapter_DbTable failed to produce a valid sql statement

前端 未结 7 2234
终归单人心
终归单人心 2021-01-25 01:53

I have the following exception Caught exception: The supplied parameters to Zend_Auth_Adapter_DbTable failed to produce a valid sql statement, please check table and colum

7条回答
  •  -上瘾入骨i
    2021-01-25 02:51

    I had the same error and found it to be misleading. In my case, it turned out that I was connect to the wrong database for reasons not worth explaining. What you want to do is get the previous exception that caused Zend_Auth_Adapter_DbTable to throw the exception you mentioned. Below is how I accomplished this:

        $adapter = $this->_getAuthAdapter();
        $adapter->setIdentity($values['username']);
        $adapter->setCredential($values['password']);
    
        $auth = \Zend_Auth::getInstance();
        try {
            $result = $auth->authenticate($adapter);
    
        } catch (\Zend_Auth_Adapter_Exception $ex) {
            die($ex->getPrevious()->getMessage());
        }
    

    So in the end, the answer isn't exactly:

        SET NAMES 'utf8'
    

    It could really be any number of issues. Best bet is to let MySQL tell you by getting the previous exception. Maybe the answer will be related to character encoding. In my case it wasn't.

提交回复
热议问题