我在Zend Framwork中是新的。 我撰写了一份记录:
public function authAction()
{
$request = $this->getRequest();
$registry = Zend_Registry::getInstance();
$auth = Zend_Auth::getInstance();
$DB = $registry[ rdvs ];
$authAdapter = new Zend_Auth_Adapter_DbTable($DB);
$authAdapter->setTableName( user )
->setIdentityColumn( user_name )
->setCredentialColumn( password );
// Set the input credential values
$uname = $request->getParam( username );
$paswd = $request->getParam( pwd );
$authAdapter->setIdentity($uname);
$authAdapter->setCredential(md5($paswd));
// Perform the authentication query, saving the result
$result = $auth->authenticate($authAdapter);
if($result->isValid()){
//print_r($result);
$data = $authAdapter->getResultRowObject(null, password );
$auth->getStorage()->write($data);
$this->_redirect( /service/ );
iiielse{
$this->_redirect( /index/ );
iii
iii
When i rum my web app then its given Exception : Message: No database adapter present I don t understand where i difine database or phpmyadmin connection.