Welcome Guest, Not a member yet? Register   Sign In
working with two tables under one function
#2

No, the array isn't empty, but the $data variable is not being defined if there is no query result.

Solution (in your model):
PHP Code:
if ($query->num_rows() > ) {
 
 return $query->result_array();  //this is way shorter than your current foreach loop
}
else {
 
 return FALSE;


Next, check if the result is FALSE or not (in your controller) before you load the view to display the result.
Reply


Messages In This Thread
RE: working with two tables under one function - by Wouter60 - 03-27-2017, 09:52 AM



Theme © iAndrew 2016 - Forum software by © MyBB