Welcome Guest, Not a member yet? Register   Sign In
Active Record question
#3

[eluser]Bondie[/eluser]
Code:
$get_rece = $this->db->query("SELECT `id`, `title`, `slug`, `category_id`, `user_id`, `price`, `date_start`, `date_end`, `description`, `images` FROM (`classifieds_listings`) WHERE `id` IN (".$comma_separated.") AND `date_end` > 1327857702 AND `date_start` < 1327857702 ORDER BY FIELD(`id`, ".$comma_separated.")");

This does the trick, producing:
Quote:SELECT `id`, `title`, `slug`, `category_id`, `user_id`, `price`, `date_start`, `date_end`, `description`, `images` FROM (`classifieds_listings`) WHERE `id` IN (3,7,2,6,1) AND `date_end` > 1327857702 AND `date_start` < 1327857702 ORDER BY FIELD(`id`, 3,7,2,6,1)


Messages In This Thread
Active Record question - by El Forum - 01-29-2012, 10:10 AM
Active Record question - by El Forum - 01-29-2012, 10:46 AM
Active Record question - by El Forum - 01-29-2012, 11:50 AM
Active Record question - by El Forum - 01-29-2012, 11:58 AM
Active Record question - by El Forum - 01-29-2012, 12:04 PM



Theme © iAndrew 2016 - Forum software by © MyBB