Welcome Guest, Not a member yet? Register   Sign In
Help with a simple query
#7

[eluser]davidbehler[/eluser]
add this at the bottom of your function in the model
Code:
if($query->num_rows() > 0) {
  return $query->result_array();
} else {
  return FALSE;
}

and in your view add a check to see if the returned result is an array:
Code:
<?php
if(is_array(todaysReservations)) {
  foreach($todaysReservations as $rowtodaysReservations) {
    echo $rowtodaysReservations->reservationID;?>
  }
} else {
  echo 'No reservations';
}
?>


Messages In This Thread
Help with a simple query - by El Forum - 03-12-2011, 11:09 PM
Help with a simple query - by El Forum - 03-13-2011, 12:02 AM
Help with a simple query - by El Forum - 03-13-2011, 12:07 AM
Help with a simple query - by El Forum - 03-13-2011, 02:31 AM
Help with a simple query - by El Forum - 03-13-2011, 04:36 AM
Help with a simple query - by El Forum - 03-13-2011, 01:49 PM
Help with a simple query - by El Forum - 03-13-2011, 02:20 PM
Help with a simple query - by El Forum - 03-13-2011, 03:12 PM
Help with a simple query - by El Forum - 03-13-2011, 03:41 PM



Theme © iAndrew 2016 - Forum software by © MyBB