Welcome Guest, Not a member yet? Register   Sign In
Check Available Rooms For Selected Dates
#5

You can check the available rooms with a subquery.

PHP Code:
$this->db
->select('room_no')
->
from('reservation')
->
where('days >='$date_in)
->
where('days <='$date_out);
$where_clause $this->db->get_compiled_select();

$query $this->db->where("room_id NOT IN ($where_clause)"NULLFALSE)->get('rooms');
if (
$query->num_rows() == 0) {
 
  return FALSE;
}
else {
 
  return $query->result();

Reply


Messages In This Thread
RE: Check Available Rooms For Selected Dates - by Wouter60 - 05-29-2019, 10:32 AM



Theme © iAndrew 2016 - Forum software by © MyBB