CodeIgniter Forums
JOIN query problem - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: JOIN query problem (/thread-18953.html)



JOIN query problem - El Forum - 05-23-2009

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


JOIN query problem - El Forum - 05-23-2009

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