kb9yjg Posted July 24, 2008 Share Posted July 24, 2008 Hello everyone, I have a script I have been working on to create a weekly event calendar. What I need done is placing the two links at the proper positions i.e. date and time. I also need logic to figure out what else is blank and fill in with nbsp's as well as an ending </tr> that is until more events get added. What its not doing is populating the link in the right box for date and time, not providing remaining cells as nbsp. Check out http://bitsonline.vndv.com/index.php for a demo. I will have the file below as well. Your assistance is greatly appreciated. <? include('inc/connect.inc'); $table="events"; $q="select * from $table"; $res=mysql_query($q) or die("Error selecting events. ".mysql_error()); $stime = strtotime('12am'); for ($i = 0; $i < (24 * 4); $i++) { $tod = $stime + ($i * 30 * 60); $display = date('h:i A', $tod); if (substr($display, 0, 2) == '00') { $display = '12' . substr($display, 2); } echo '<tr><td scope=row align=center>'.$display.'</td>'; while($row=mysql_fetch_assoc($res)){ if(empty($row['event'])){echo '<td> </td>';} echo '<td align="center"><a title="'.$row['eday'].'<br />'.$row['evtime'].'<br />'.$row['about'].'">'.$row['event'].'</a></td>'; } } echo "</tr>"; ?> the above code prints out time in incriments of .5 hours then connects to the db and tries to retrieve the data upon which it is getting echoed in the first two squares as opposed to proper dates and times. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.