CodeIgniter Forums
$this->db->where(); custom string problem - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: $this->db->where(); custom string problem (/showthread.php?tid=45526)



$this->db->where(); custom string problem - El Forum - 09-25-2011

[eluser]livewirerules[/eluser]
Im trying to select some values using a custom string. below is my code


Code:
$this->db->from('posted');
  $st="infor='rent' AND (typeq='in' OR typeq='out')";
  $this->db->where($st);  
  $q = $this->db->get();

Quote:A Database Error Occurred

Error Number: 1054

Unknown column 'infor='rent'' in 'where clause'
SELECT * FROM (`posted_ads`) WHERE `infor='rent'` AND (typeq='in' OR typeq='out')
Filename: C:\wamp\www\parklot\system\database\DB_driver.php
Line Number: 330



i think the problem is coz of
Code:
WHERE `infor='rent'`

when i manualy execute this code it works perfectly.
Code:
WHERE infor='rent'

how do i get rid of
Code:
``
because its automatically added