Hey everybody. I am trying to print out a schedule with thirty minute intervals and would like to query a DB to get whatever thing is happening at that time. If i manually enter the time (hour, minute, am/pm(months, year, day work as is)) i get events. It's just when i let the query pull the time from the loop this doesnt work. Any ideas?
$day = date('d');
$year = date('Y');
$month = date('m');
$start = mktime(0,0,0);
$thing_query="SELECT thing FROM things WHERE day='$day' AND month='$month' AND year='$year' AND hour='$hour' AND minute='$minute' AND ampm='$am'";
$result=mysql_query($thing_query);
for($min = 0; $min < 24 * 60 * 60; $min += 30 * 60)
{
$hour=date("h", $start + $min);
$minute=date("i", $start + $min);
$am=date("A", $start + $min);
while ($row=mysql_fetch_array($result)) {
$thing = $row[0];
}
printf("<tr><td>%s</td><td>$thing</td></tr>",
date("g:i a", $start + $min));
}