http://timgriffinforcongress.com/calendar.php
What's the best way to make that warning go away and replace it with "Nothing on the calendar"?
I put this on the page...
if (!$result) {
die('Nothing currently on the calendar. Check back soon.' . mysql_error());
}
And the page formatting fell apart.
I am functional at inserting, updating, and displaying data in PHP...that's about it. Here's the code that I'm using.
[FONT="Courier New"]mysql_select_db("griffincongress", $con);
$query="SELECT * FROM calendar where display = 'Y' and event_date > now() ORDER BY event_date";
$result=mysql_query($query) or die (mysql_error());
$int=mysql_numrows($result);
$i=0;
do {
$event_title=mysql_result($result,$i,"event_title");
$event_date=mysql_result($result,$i,"event_date");
$cid=mysql_result($result,$i,"calendar_id");
$event_date = date('M d, Y', strtotime($event_date));
$i++;
echo'
<tr>
<td width="18" background="gfxbox/left_edge.jpg"> </td>
<td background="gfxbox/grey_bkgd.jpg">
<table width="100%"><tr>
<td width="100">'. $event_date .'</td><td>
<strong><a href="calendar_view.php?cid=' . $cid . '">'. $event_title .'</a></strong>
</td></tr></table>
<td width="18" background="gfxbox/right_edge.jpg"> </td>
</tr>
';
}
while ($i < $int);
;
?>
[/FONT]