Welcome Guest, Not a member yet? Register   Sign In
Database trouble - Error Number: 1096
#2

[eluser]Armchair Samurai[/eluser]
I don't think this is a bug - AFAIK count_all_results() does not use select(), which is probably causing the error. Using count_all_results() creates

Code:
SELECT COUNT(*) AS numrows

meaning you can also get rid of the order_by() and limit() without affecting the outcome, so you'd end up with:

Code:
$this->db->from(’tbl_gallery’);
$this->db->join("tbl_users", “gallery_user = usr_id");
$this->db->join("tbl_gallery_albums", “gallery_album = album_id");
$this->db->where(’gallery_user’, $userid);
$this->db->where(’gallery_album’, $gallery);
$total = $this->db->count_all_results();


Messages In This Thread
Database trouble - Error Number: 1096 - by El Forum - 02-24-2008, 08:21 PM
Database trouble - Error Number: 1096 - by El Forum - 02-24-2008, 08:31 PM
Database trouble - Error Number: 1096 - by El Forum - 02-25-2008, 02:27 AM
Database trouble - Error Number: 1096 - by El Forum - 02-25-2008, 07:23 AM
Database trouble - Error Number: 1096 - by El Forum - 02-25-2008, 07:36 AM
Database trouble - Error Number: 1096 - by El Forum - 02-25-2008, 07:38 AM
Database trouble - Error Number: 1096 - by El Forum - 02-25-2008, 08:07 AM
Database trouble - Error Number: 1096 - by El Forum - 02-26-2008, 09:03 AM
Database trouble - Error Number: 1096 - by El Forum - 02-26-2008, 09:13 AM
Database trouble - Error Number: 1096 - by El Forum - 02-26-2008, 09:31 AM
Database trouble - Error Number: 1096 - by El Forum - 11-26-2008, 09:16 AM
Database trouble - Error Number: 1096 - by El Forum - 07-18-2010, 12:16 PM
Database trouble - Error Number: 1096 - by El Forum - 07-18-2010, 12:24 PM
Database trouble - Error Number: 1096 - by El Forum - 07-19-2010, 10:38 PM



Theme © iAndrew 2016 - Forum software by © MyBB