Welcome Guest, Not a member yet? Register   Sign In
DB Active Record issue
#1

[eluser]Eric Barnes[/eluser]
Hi everyone.

I am running CI 1.6.1 which I know is a little old now and I didn't want to upgrade if I didn't have to. Smile

My problem is I have this query:
Code:
$this->db->distinct();
        $this->db->select('a_id, a_uri, a_title, a_display, a_hits');
        $this->db->from("articles");
        $this->db->join('article2cat', 'articles.a_id = article2cat.article_id', 'left');
$query = $this->db->get();

Which outputs as:
SELECT DISTINCT a_id, a_uri, a_title, a_display, a_hits FROM (a_articles) LEFT JOIN a_article2cat ON a_articles.id = a_article2cat.article_id

Notice that the table names becomes a_article2cat and a_articles where it should be just article2cat and articles.

Does anyone have any idea on what would be causing that?




Theme © iAndrew 2016 - Forum software by © MyBB