CodeIgniter Forums

Full Version: JOIN query problem
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]vps4[/eluser]
I using SQLITE database

when I do this
Code:
$this->db->select('article.ID, article.node_ID, article.title, node.node_title');
            $this->db->from('article');
            $this->db->join('node', 'node.node_ID = article.ID');
            $this->db->limit(1);
            $query = $this->db->get();

it give me an error:

Code:
A Database Error Occurred
Error Number: 1

SQL logic error or missing database

SELECT article.ID, article.node_ID, article.title, node.node_title FROM (article) JOIN node ON node.node_ID = article.ID LIMIT 1

how can I fix it?

El Forum

[eluser]geocine[/eluser]
Try this:

Code:
$this->db->select('*');
            $this->db->from('article');
            $this->db->join('node', 'node.node_ID = article.ID');
            $this->db->limit(1);
            $query = $this->db->get();

and see what you get.