Welcome Guest, Not a member yet? Register   Sign In
[SOLVED]WHERE_IN() not doing what I thought
#1

[eluser]bobbob[/eluser]
When I do this query:
Code:
$query = "SELECT * FROM articles ";

$query .= " WHERE second_theme IN ( ".$_POST['secondary_theme']." ) ";

it isn't the same as

Code:
$this->db->where_in('second_theme', $_POST['secondary_theme']);
$this->db->get('articles');

Any thoughts??
#2

[eluser]bretticus[/eluser]
Why not echo out $this->db->last_query() to compare?
#3

[eluser]bobbob[/eluser]
Active record does this:
Code:
SELECT * FROM (`articles`) WHERE `second_theme` IN ('15')
and the written query does:
Code:
SELECT * FROM articles WHERE second_theme IN ( 15 )

Any solution?
#4

[eluser]bobbob[/eluser]
FIND_IN_SET was what I had needed.




Theme © iAndrew 2016 - Forum software by © MyBB