CodeIgniter Forums

Full Version: Strange database issue when WHERE contains brackets
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum


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.

El Forum

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