im getting a mysql error with my query for some reason…
heres the function in my model
function get_events($num, $offset)
{
$query = $this->db->query("SELECT * FROM test WHERE end >= NOW() ORDER BY ASC LIMIT $num, $offset");
return $query;
}and heres my controller
$this->load->library('pagination');
$config['base_url'] = 'http://mysite.com/mains/index/';
$config['total_rows'] = $this->db->count_all('test');
$config['per_page'] = '5';
$this->pagination->initialize($config);
//load the model and get results
$this->load->model('Frontmodel');
$data['query'] = $this->Frontmodel->get_events($config['per_page'],$this->uri->segment(3));heres the error im getting
A Database Error Occurred
Error Number: 1064
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘ASC LIMIT 5, 3’ at line 1
SELECT * FROM test WHERE end >= NOW() ORDER BY ASC LIMIT 5, 3
any idea whats goin on here?