php calendar not showing appointments

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
justravis
Forum Commoner
Posts: 53
Joined: Mon Dec 16, 2002 3:18 am
Location: San Diego, CA
Contact:

php calendar not showing appointments

Post 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.
justravis
Forum Commoner
Posts: 53
Joined: Mon Dec 16, 2002 3:18 am
Location: San Diego, CA
Contact:

Post 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
Post Reply