Parentheses escaping within ActiveRecord |
[eluser]Unknown[/eluser]
I have to perform the following database query: Code: SELECT * FROM albums I am using ActiveRecord within C.I.: Code: $q = $this->db->get_where('albums',array('artist_name'=>$artist, 'album_name'=>$album)); However the parentheses are automatically escaped before querying the database: Code: SELECT * ....and nothing is returned I have tried the C.I. wiki work around but still no success. How can I query the database with field values that contain parenthesis? Kind regards, Stegre.
[eluser]pickupman[/eluser]
change get_where() to the two separate ->get() and ->where(). $this->db->where() accepts an optional third parameter. If you set it to FALSE, CodeIgniter will not try to protect your field or table names with backticks. |
Welcome Guest, Not a member yet? Register Sign In |