I’m using the DB class of CI framework. There’re 5 rows queried out from the first line, and the second line printed 5, but why did the statement count($query->row_array())(or count($query->row_array(),1)) returned 11(the field number of table) and only one row filled in the result, rather than 5 rows?
$query = $this->db->query($SQL_BYLABEL, array($labelId, $orderby, (int)$m, (int)$n));
log_message('error', $query->num_rows()); // 5 rows
log_message('error', count($query->row_array())); // 11
$query->row_array()returns the data of one record as an array. Socount($query->row_array()return the number of columns of the table.Check the manual.