我在mysql中有表:
编号 | 数字1 | 数字2| 数字 3| 数字3| 数字5| 1 | 6 | 3 | 4 | 2 | 1 |
$数字=数字2;$val = 2; $id = 2;
如果我使用
$q = Doctrine_Query::create()
->update('TABLE')
->set($num, '?', $val)
->where('id = ?', $id)
->execute();
工作正常,但我使用:
$q = Doctrine_Query::create()
->from('TABLE')
->where('id = ?', $id)
->andWhere($num ,' ?', $val)
->execute();
不起作用。我有:500 内部服务器错误
Doctrine_Connection_Mysql_Exception: SQLSTATE[HY093]: Invalid parameter number: 绑定变量数与令牌数不匹配
我究竟做错了什么?