Page 1 of 1

php calendar not showing appointments

Posted: Thu Feb 06, 2003 1:22 pm
by justravis
I'm trying to create a calendar where people can reserve time. The problem is that apointments are not showing up.

Page:
http://clients.justravis.com/spawar/schedule.tap

Code:
http://clients.justravis.com/spawar/schedule.taps

Queries:
SELECT beg, end, name.name FROM reservation, name WHERE mo='2'AND day='10' AND yr='2003' AND reservation.nameid=name.id

SELECT beg, end, name.name FROM reservation, name WHERE mo='2'AND day='10' AND yr='2003' AND beg='8:00' AND reservation.nameid=name.id

Both Return:
08:00:00 10:00:00 Warhead Locator Phase 1

Here is some other info that may be relevent:

beg & end are in time format in mysql. From mySQL manual:
TIME values with colons, by contrast, are always treated as time of the day. That is '11:12' will mean '11:12:00', not '00:11:12'
$time is an array that contains the times of the day. Here is the for loop that creates it:

Code: Select all

<?php
#Populating time array.
for($i=8; $i<=17; $i++)
{
    $time[]= $i . ':00';
}
?>
Any assistance would be greatly appreciated.

Posted: Thu Feb 06, 2003 1:45 pm
by justravis
In order to pinpoint the problem, I added this to the while loop that looks for a match in the db result:

Code: Select all

<?php
            #SHOULD echo each begin time in reult for EACH $value
            $beg=$reserved[beg];
            echo "$value - $beg<br>";
?>
It echoed the first time from time array, but no beginning times.

Don't even know how to respond to that.

Check it out:
http://clients.justravis.com/spawar/schedule2.tap

Code:
http://clients.justravis.com/spawar/schedule2.taps