We have a few scripts that get latest posts etc that get written to a js file for including on non-vb pages. After upgrading from 2 to latest 3 these all work except for the one accessing the calendar.
The php routine we have always used is as follows, then the error we get. Presume the calendar is held differently in vb3 - Any help appreciated.
require("includes/config.php");
$num_active = 20;
$num_chars = 75;
$db=mysql_connect($servername,$dbusername,$dbpassw ord);
mysql_select_db($dbname);
$fp = fopen("news/events10.js", "w");
@flock($fp, 2);
$today = date("Y-m-d",time());
print ("$today<br>");
$querylatest="SELECT event, DATE_FORMAT(eventdate,'%a %d %b') AS date,
eventdate, eventid, subject
FROM calendar_events WHERE (public = 1 AND eventdate>='$today') ORDER BY eventdate LIMIT $num_active";
echo $querylatest;
$resultlatest = mysql_query($querylatest,$db);
while ($event = mysql_fetch_array($resultlatest)) {
$eventid = $event[eventid];
$eventtitle = addslashes($event[subject]);
$eventdate = $event[date];
print ("<b>$eventid $eventtitle $eventdate</b><br>");
fputs($fp, "document.write(\"<a href='http://www.southportforums.com/forums/calendar.php?action=getinfo&eventid=$eventid'>$eve nttitle</a> $eventdate<br>\");\n");
}
@fclose($fp);
print ("<br><b><u>Events Have been updated - Thank You</u></b><br><br>");
Causes error....
2004-09-04
SELECT event, DATE_FORMAT(eventdate,'%a %d %b') AS date, eventdate, eventid, subject FROM calendar_events WHERE (public = 1 AND eventdate>='2004-09-04') ORDER BY eventdate LIMIT 20
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result
|