CodeIgniter Forums
Order_by and Group_by Problem - Printable Version

+- CodeIgniter Forums (
+-- Forum: Archived Discussions (
+--- Forum: Archived Development & Programming (
+--- Thread: Order_by and Group_by Problem (/thread-26786.html)

Order_by and Group_by Problem - El Forum - 01-23-2010

I have been struggling to select the latest record (message) of each user in my database.

I am joining two tables to generate the data I need to display: r_user and r_logbook

$this->db->join('r_logbook', 'r_logbook.user_id =');
$query = $this->db->get('r_user');
return $query->result_array();

This obviously doesn't work, but is the best explanation of what I'd like to do. There must be another direction from which I could approach this, please let me know what you think or if you need any other info.