You tried to change this if ($query5->num_rows() < 0) { to something like if ($query5->num_rows() <= 0) { , just a thought. This will make a difference because you tell him that it will only execute if it is less than zero , but can be equal to zero , and you will go to the else statement.
And only for CodeIgniter num_rows() help:
public function num_rows() { if (is_int($this->num_rows)) { return $this->num_rows; } elseif (count($this->result_array) > 0) { return $this->num_rows = count($this->result_array); } elseif (count($this->result_object) > 0) { return $this->num_rows = count($this->result_object); } return $this->num_rows = count($this->result_array()); }
PhearOfRayne
source share