inherit
66746
0
Oct 7, 2012 14:05:38 GMT -8
«The Silver Lining»™
^ Me !!!!
1,338
December 2005
chrisrulez001
|
Post by «The Silver Lining»™ on Jan 8, 2010 7:05:02 GMT -8
Hi there,
Ive been making a php booking system and it doesnt seem to be doing what i ask it to do.
What im try to have it do is, say the place is booked on one day and ends on 3 days after the booking has started, i would like to have the centre dates to show booked aswell not just the start and end dates, if this is possible.
function is_booked($pitch_number, $start_date, $end_date) { $this->init_mysql();
$query1 = "SELECT * FROM pitches WHERE pitch='$pitch_number' AND booking_starts<='$start_date' AND booking_ends>='$start_date' AND booked=1 order by pitch"; $result1 = mysql_query($query1) or die (mysql_error()); $pitch = mysql_fetch_array($result1);
if(($start_date == $pitch['booking_starts'])) { return true; } elseif(($start_date == $pitch['booking_ends'])) { return true; } else { return false; } }
Thanks in advance.
EDIT: I was executing a wrong query thats why it wasnt filling the centre dates in.
|
|