0
由于我是新的symfony框架,为我的客户端symfony网站做维护。我试图将一个记录插入到一个新表中,该表实际上是一个已经存在的表的子表。Symfony插入子表
但我无法在此写入插入查询。仅显示错误。
请检查并为下面的代码的解决方案,
public function executeUpdatednc(sfWebRequest $request)
{
$patient_id = $_REQUEST['pid'];
$q = Doctrine_Query::create()
->update('patient')
->set('isadmindnc', '?', 1)
->where('id = ?', $patient_id)
->execute();
$datetime = date("Y-m-d H:i:s");
##### Here i need to write the sub query to insert into the new table, Please suggest #####
//$rsm = new ResultSetMapping();
//$query = $this->_em->createNativeQuery('INSERT INTO patient_phone SET ph_pid = ?', $patient_id);
//$query->setParameter(1, $items);
//$result = $query->getResult();
}
你正在使用1. *版我认为,但标签为'symfony2' .. – xurshid29 2014-08-27 11:30:22
是的,这是symfony 1,有没有任何选择要做到这一点,任何想法? – 2014-08-27 11:58:47
对不起,我很乐意帮助你,但我从来没有试过v1。* .. – xurshid29 2014-08-27 12:34:36