Query not showing all the rows - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24) +--- Thread: Query not showing all the rows (/showthread.php?tid=63072) |
Query not showing all the rows - gepd - 09-22-2015 Hi, I'm using the last current version of C.I, and I having a wierd problem with a query. I'm doing this query: PHP Code: public function get_event(){ it show me "72" but in the table log_event I have 172 rows if I paste the same query in MYSQL Workbench, it shows me 172 rows, what I'm doing wrong? is there some limit in the C.I queries? RE: Query not showing all the rows - DEV03-ROMAIN - 09-23-2015 (09-22-2015, 10:57 PM)gepd Wrote: Hi, I'm using the last current version of C.I, and I having a wierd problem with a query. you could try this instead of num_rows() PHP Code: count_all_results(); Quote:it show me "72" but in the table log_event I have 172 rows looks like you just missing the " 1" ... maybe variable type problems. Can we see full code of your problem ? RE: Query not showing all the rows - gepd - 09-23-2015 Thanks for your answer DEV03-ROMAIN, I already tried with with something else than Code: num_rows() but it's the same result there is the full code: Model Code: <?php and this is the controller Code: <?php I know there is an error, be cause I can see only 72 rows, and I already check the db, the data is there. RE: Query not showing all the rows - Martin7483 - 09-24-2015 I would start by breaking down your query to see if you get different results. PHP Code: $this->db->query("SELECT * FROM log_event"); // Start here and keep building up to what you want RE: Query not showing all the rows - DEV03-ROMAIN - 09-24-2015 (09-23-2015, 11:02 AM)gepd Wrote: Thanks for your answer DEV03-ROMAIN, I already tried with with something else than hmmm, your code seems to be ok for me. Do you have the 172 rows in $json["datails"] ? Did you try doing echo $query -> num_rows(); just after $query -> result(); |