Welcome Guest, Not a member yet? Register   Sign In
Active Record join condition subquery escaped SELECT
#1

[eluser]Unknown[/eluser]
When I try to join with a subquery as a condition, the SELECT statement from that subquery is escaped what leads to a database error.

Example :
Code:
$this->db->select('*');
$this->db->from('blogs');
$this->db->join('comments', 'comments.id = (SELECT id FROM blogs WHERE ....)');

$query = $this->db->get();

// Produces:
// SELECT * FROM `blogs`
// JOIN `comments` ON `comments`.`id` = (`SELECT` id FROM blogs WHERE ...)

Note that SELECT is the only word that is escaped from that subquery.


Messages In This Thread
Active Record join condition subquery escaped SELECT - by El Forum - 06-22-2012, 07:17 PM
Active Record join condition subquery escaped SELECT - by El Forum - 06-23-2012, 12:39 AM
Active Record join condition subquery escaped SELECT - by El Forum - 06-23-2012, 03:13 PM
Active Record join condition subquery escaped SELECT - by El Forum - 09-21-2012, 03:09 AM
Active Record join condition subquery escaped SELECT - by El Forum - 10-03-2012, 02:06 AM



Theme © iAndrew 2016 - Forum software by © MyBB