Welcome Guest, Not a member yet? Register   Sign In
CodeIgniter App getting data from the wrong mySQL table?
#13

[eluser]Dave Blencowe[/eluser]
Changing the get_comments function in the model to this:
Code:
function get_comments($id)
    {
        $this->db->order_by('id', 'desc');
        $this->db->where('post_id', $id);
        $this->db->from('content_blog');
        $comments = $this->db->get('content_test');
        
        return $comments->row_array();
    }

Gives me the following error:
Code:
A Database Error Occurred

Error Number: 1052

Column 'id' in order clause is ambiguous

SELECT * FROM (`content_blog`, `content_test`) WHERE `post_id` = '1' ORDER BY `id` desc

[b]EDIT: Ignore that, I'm an idiot lol. Changing it from content_blog to content_test does nothing.


Messages In This Thread
CodeIgniter App getting data from the wrong mySQL table? - by El Forum - 10-07-2008, 04:21 AM



Theme © iAndrew 2016 - Forum software by © MyBB