Welcome Guest, Not a member yet? Register   Sign In
Active Record error with order_by random
#1

[eluser]fatdog[/eluser]
I'm getting this error.
Quote:Unknown column ' RAND() LIMIT 1' in 'order clause'
SELECT * FROM (`camp`) WHERE `secc` = 7 ORDER BY ` RAND() LIMIT 1

Code:
$this->db->order_by("id","random");
$this->db->where('secc',7);
$this->db->limit(1);
$query = $this->db->get('camp');

Am I doing something wrong?

I'm using version 1.7.0


Messages In This Thread
Active Record error with order_by random - by El Forum - 02-16-2009, 10:22 AM
Active Record error with order_by random - by El Forum - 02-16-2009, 11:29 AM
Active Record error with order_by random - by El Forum - 02-16-2009, 11:40 AM
Active Record error with order_by random - by El Forum - 02-16-2009, 11:43 AM
Active Record error with order_by random - by El Forum - 02-16-2009, 11:48 AM
Active Record error with order_by random - by El Forum - 02-16-2009, 11:50 AM



Theme © iAndrew 2016 - Forum software by © MyBB