CodeIgniter Forums
Database error, but no error number or message - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: Database error, but no error number or message (/thread-45740.html)



Database error, but no error number or message - El Forum - 10-04-2011

[eluser]digity[/eluser]
I'm getting an empty result return on the model code below and a page title that just says "Database error"... no actual mysql error number or message is given anywhere:

Code:
$this->db->select('topics.topic_id');
$this->db->select('COUNT(*) AS comment_count');
$this->db->from('topics');
$this->db->from('comments');
$this->db->where('topics.topic_id','comments.topic_id');
$this->db->where('comments.comment_created >= NOW() - INTERVAL '.$options['time_number'].' '.$options['time_unit']);
$this->db->group_by('topics.topic_id');
$this->db->order_by('comment_count', 'DESC');

Any ideas?


P.S. - Yes, the query works and it runs fine the long way with $this->db->query() (but I need the above structure to work).