使用DB查询生成器在Kohana 3中构建交叉表更新的正确方法是什么?Kohana 3使用查询生成器进行交叉表更新
目前我只是使用DB :: expr,但我知道查询生成器比这更聪明。
// update record
$rows_updated = DB::update(DB::expr('user_list_permissions INNER JOIN users ON user_list_permissions.user_id = users.id'))
->set($params)
->where('user_list_permissions.id', '=', $user_list_permission_id)
->where('users.account_id', '=', $this->account_id)
->execute();
是的,当然我试图用建立SELECT查询时像“加盟”的方法,但我收到一个错误:
ErrorException [ 1 ]: Call to undefined method Database_Query_Builder_Update::join()
不,不适用于更新。来自服务器的响应:ErrorException [1]:调用未定义的方法Database_Query_Builder_Update :: join() – JoshuaDavid
从3.1开始,“join”方法是否添加到Database_Query_Builder_Update对象?我在v3.1.3.1(araea)中测试 – JoshuaDavid
v.3.3.3在Database_Query_Builder_Update上没有连接方法。 – Zoon