CodeIgniter Forums
CodeIgniter is discarding JOIN clause in SQL statement - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: CodeIgniter is discarding JOIN clause in SQL statement (/showthread.php?tid=44557)



CodeIgniter is discarding JOIN clause in SQL statement - El Forum - 08-18-2011

[eluser]sehummel[/eluser]
I have the following function in one of my models:

Code:
function update_uu_feature($feature, $lang, $data)
{
    $feature = str_replace('_', '-', $feature);
    $this->db->where('navigation', $feature);
    $this->db->where('language', $lang);
    $this->db->join('all_video_names', 'all_video_names.video_id = all_uu_features.video_id', 'inner');
    return $this->db->update('all_uu_features', $data);
}

But the "join" line gets discarded. In the profiler, it outputs:

Code:
UPDATE `all_uu_features` SET `page_title` = 'Laser', `title` = 'Test', `keywords` = 'Test', `description` = 'Test', `feature_text` = '<p>Test text</p>', `learn_more_about` = 'Test Text 2', `overview` = 'test', `copy` = 'test' WHERE `navigation` = 'laser-interface' AND `language` = 'en'

Can someone help me with the syntax? Thanks. Most of the data is in the all_uu_features table, except for the video name, which is in the all_video_names table. The two are joined on the video_id.