when i am update my form, i got this error 500 | Internal Server Error | Doctrine_Connection_Mysql_Exception
executeEdit
public function executeEdit(sfWebRequest $request)
{
$this->form = new ContactForm();
$this->rs = Doctrine::getTable('login')-> find($request->getParameter('id'));
$id=$request->getParameter('id');
$unm=$this->rs['username'];
$msg=$this->rs['message'];
$em=$this->rs['email'];
$sub=$this->rs['subject'];
$this->form->setDefault('id', $id);
$this->form->setDefault('username', $unm);
$this->form->setDefault('message', $msg);
$this->form->setDefault('email', $em);
$this->form->setDefault('subject', $sub);
//$this->forward404Unless($this->rs);
if ($request->isMethod('post'))
{
$this->form->bind($request->getParameter('contact'), $request->getFiles('contact'));
if ($this->form->isValid())
{
$name="'".$this->form->getValue('username')."'";
$message="'".$this->form->getValue('message')."'";
$email="'".$this->form->getValue('email')."'";
$sub="'".$this->form->getValue('subject')."'";
$id=$this->form->getValue('id');
$file = $this->form->getValue('doc');
$filename = sha1($unm).'_'.sha1($file->getOriginalName());
$extension = $file->getExtension($file->getOriginalExtension());
$path=sfConfig::get('sf_upload_dir').'/'.$filename.$extension;
$qs= Doctrine_Query::create()
->update('login l')
->set('l.username', $name)
->set('l.message', $message)
->set('l.email', $email)
->set('l.subject', $sub)
->set('l.doc', $path)
->where('l.id=?',$id)
->execute();
$this->redirect('user/show?id=' . $id);
}
}
}
this is my edit action code. so whats the exaclty error. and what is my mistake and what can i do to solve this error? please help me