私は2つのテーブルを持っています:
table1: id、user_id、poll_id、options_id
table2: id、poll_id、投票
列の投票は整数であり、いくつかの where 句でテーブルを結合して値を変更したい:
$this->db
->set('votes', 'votes - 1', FALSE)
->join('table1', 'poll_votes.options_id = table2.id')
->where('poll_id', $row)
->where('user_id', $id)
->update('table2');
次のエラーが表示されます。
エラー番号: 1054 「where句」の不明な列「user_id」 UPDATE `table2` SET 票 = 票 - 1 WHERE `poll_id` = '9' AND `user_id` = '1'