Hi group
I am playing with a small scheduling app and am getting slightly stuck...
Basically I have a table showing different time blocks for every 15mins filled in from mysql..at the moment is coded really ugly and works slow as each <td> runs a query..now I am trying to fix it and have got the below to build the table:
echo "<table width=\"50%\" border=\"1\" cellpadding=\"0\" cellspacing=\"1\"><tr>";
$start = 7*60+0;
$end = 13*60+0;
for($time = $start; $time<=$end; $time += 15)
{
$minute = $time%60;
$hour = ($time-$minute)/60;
$ty= sprintf('%2d:%02d', $hour, $minute);
echo "<td width=\"100\" height=\"100\">\n";
echo $ty;
}
echo "</td>";
echo "</tr></table>";
now problem no.1. how do i make it start a new <tr> every 4 <td> ?
prob. 2. I want to show the data from mysql which co-incides from the current value of the time $ty
I have been playing with some code using "each" but it's messy and i'm banging my head now...I'm sure you 'gurus' can come up with a simple way to do it