0
當用戶名或密碼錯誤時,出現此錯誤。正確的用戶名和密碼時運行成功。 調用一個成員函數count()在....調用非對象的成員函數count()
我的代碼非對象是
public function executeLogin(sfWebRequest $request)
{
$this->form = new loginForm();
if ($request->isMethod('post'))
{
$this->form->bind($request->getParameter('login'));
if ($this->form->isValid())
{
$unm=$this->form->getValue('username');
$pwd=$this->form->getValue('password');
$q = Doctrine_Query::create()
->select('id')
->from('login')
->andWhere('username = ?', $unm)
->andWhere('password = ?', $pwd);
$q->execute();
$result = $q->fetchOne();
if ($result->count() > 0)
{
$this->getUser()->setAuthenticated(true);
$this->getUser()->addCredential('user');
$this->redirect('user/index');
}
else
{
$this->redirect('user/login');
}
}
}
}
請,張貼棧回溯。 – Jacobson
我是新的symfony1.4,所以我不知道你想要什麼 – hemsbhardiya