db->join("table", "column = " . $int) ... uses backticks and gives an error!

#1
[eluser]pmhart[/eluser]
I am trying to do the following:

$this->db->join("tab as t", "t.id = " . $tab_id);

And I get an error that says:

Unknown column '25501' in 'on clause'

Given the $tab_id=25501, CI creates a query like this

JOIN `tab` as t ON `t`.`id` = `25501`

I need that number to not have backticks! I can do it as a valid query manually in mySQL, any suggestions?


Messages In This Thread
db->join("table", "column = " . $int) ... uses backticks and gives an error! - by El Forum - 09-18-2009, 05:01 PM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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