Welcome Guest, Not a member yet? Register   Sign In
CodeIgniter is discarding JOIN clause in SQL statement
#1

[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.




Theme © iAndrew 2016 - Forum software by © MyBB