我才意識到,你不能使用:
$this->db->join()
與
$this->db->update()
看來「加盟「由codeigniter正常執行,但未在查詢中使用,在使用以下命令獲取的基本表更新後出現:$ this-> db-> last_query();
我看到沒有加入。然後我試着對連接表進行更新,認爲只有在需要時纔會使用連接,但我沒有工作並告訴我錯誤1054「未知列XXX在where子句」。
有沒有辦法強制codeigniter?我構建軟件的方式,我真的不想自己構建查詢的所有不同部分(join,where),調用$ this-> db-> query()。
注:我看到這些鏈接:
Codeigniter active record update statement with a join
Is it possible to UPDATE a JOINed table using Codeigniter's Active Record?
codeigniter - database : how to update multiple tables with a single update query
,但如果有人知道一個更清潔的方式,將是很好的,因爲這些解決方案都不能有工作我因爲我在使用連接預覽變更的「preProcessing()」方法中使用了相同的連接,所以同樣的「preProcessing()」方法用於第e更換
我注意到連接語句都在$ this-> db-> ar_join中。也許有辦法強制這些 – NaturalBornCamper