CodeIgniter Forums
DB_active_rec get vs get_where - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: DB_active_rec get vs get_where (/showthread.php?tid=29492)



DB_active_rec get vs get_where - El Forum - 04-11-2010

[eluser]Unknown[/eluser]
I've just started looking at this code and I wonder about one unexplained difference between these two functions.
if ($table != '')
{
$this->_track_aliases($table);
the line above is only in get, not in get_where
$this->from($table);
}
Why is that line not in get_where?
If it were, then I would suggest that get be implemented as a call to get_where.

Also, what got me started down this path:
What's the difference between
$this->db->where($data);
$query = $this->db->get('table', $num, $offset);
and
$query = $this->db->get_where('table', $data, $num, $offset);