Strange database issue when WHERE contains brackets


Getting a very strange issue where I am querying against a database for a name for the ID.

The query is something like this. (removed table names for security reasons)

SELECT xx_id FROM (xx s) JOIN ss b ON b.xx_id = s.xx_id WHERE s.deleted !=1 AND s.xx_id =100 AND ='xxx (xxxxx)'

When the contains ( ) the query through CI will return an empty result set.

When I dump the query using last_query() and run that query in phpmyadmin I get the correct ID back...does anyone know how to get around this? or what the issue could be.

Thanks in advance.

How you executing your query? Try $this->db->query($your_query,$false)

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.