Welcome Guest, Not a member yet? Register   Sign In
CI, DB and ticks
#1

[eluser]Richard Testani[/eluser]
Why does the following:
Code:
$this->db->select('beers.name AS beer, beers.brewid, beers.tagid, beers.stub AS bstub, tags.id, tags.tag, tags.stub AS tstub, breweries.name');
$this->db->from('beers, tags, breweries');
$this->db->where('beers.tagid', 'tags.id');

result in:

Code:
SELECT `beers`.`name` AS beer, `beers`.`brewid`, `beers`.`tagid`, `beers`.`stub` AS bstub, `tags`.`id`, `tags`.`tag`, `tags`.`stub` AS tstub, `breweries`.`name` FROM (`beers`, `tags`, `breweries`) WHERE `beers`.`tagid` = 'tags.id'

Notice the final equation - beers.tagid = tags.id. CI wraps tags.id is wrapped together and with single quote marks and not ticks like the rest. It's breaking my query result.

How can I troubleshoot this?
Thanks
Rich


Messages In This Thread
CI, DB and ticks - by El Forum - 06-07-2009, 11:16 AM
CI, DB and ticks - by El Forum - 06-07-2009, 12:38 PM
CI, DB and ticks - by El Forum - 06-07-2009, 01:45 PM
CI, DB and ticks - by El Forum - 06-07-2009, 02:43 PM
CI, DB and ticks - by El Forum - 06-07-2009, 02:46 PM



Theme © iAndrew 2016 - Forum software by © MyBB