当我更新我的表格时,我收到了这个错误 500 | 内部服务器错误 | Doctrine_Connection_Mysql_Exception
执行编辑
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);
}
}
}
这是我的编辑操作代码。所以什么是精确错误。我的错误是什么,我能做些什么来解决这个错误?请帮我