02-24-2012, 01:45 PM
[eluser]Fantass[/eluser]
Hello, heres my query
Wich return me various results according to the search but i want to pick up a random one
I've tried with Mysql this query
What return me exactly what i want.
then i've try adding the line
but nothing
...
Someone could help me?
THANKS.
Hello, heres my query
Code:
$this->db->having('active', 1);
$this->db->having('widerange', 2);
$this->db->having('counter < assigned');
$query = $this->db->get('anuncios');
I've tried with Mysql this query
Code:
SELECT * FROM `anuncios` HAVING `active` = 1 AND `counter` < `assigned` AND `widerange` = 2 ORDER BY RAND() limit 1
then i've try adding the line
Code:
$this->db->order_by("id", "RAND");

Someone could help me?
THANKS.