I'm getting the following from a calendar script I dl'd...
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /www/zymichost.com/f/r/e/fretwizz/htdocs/calendar_v2/index.php on line 117
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /www/zymichost.com/f/r/e/fretwizz/htdocs/calendar_v2/index.php on line 118
Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /www/zymichost.com/f/r/e/fretwizz/htdocs/calendar_v2/index.php on line 123
The pertinent lines read:
117: $D = mysql_fetch_assoc($R);
118: $S = mysql_num_rows($R);
123: mysql_free_result($R);
Here is the php section these lines live in:
<?php
}
for ($list_day = 1; $list_day <= $daysinmonth; $list_day++) {
$tm = date("U", mktime(0, 0, 0, $month, $list_day, $year)) - 86400; // Bir gün önce
$tn = date("U", mktime(0, 0, 0, $month, $list_day, $year)); // O gün ...
$tp = date("U", mktime(0, 0, 0, $month, $list_day, $year)) + 86400; // Bir gün sonra
$Q = sprintf("SELECT * FROM `events` WHERE `date` > '%s' AND `date` < '%s' AND `day` = '%s';", $tm, $tp, $list_day);
$R = mysql_query($Q);
$D = mysql_fetch_assoc($R);
$S = mysql_num_rows($R);
$Y = $D['date'];
$TheDay = date('d', $Y);
$TheMon = date('F', $Y);
$TheYea = date('Y', $Y);
mysql_free_result($R);
if ($S) {
?>
Could this be a problem with the MySQL version number? I get it to work locally via the latest version of MAMP, which says the server version is 5.0.41 (the Zymic version is 5.0.27). I'm new to MySQL so I have no idea what's possibly causing this.
Thanks
Steve
I did a search and found that I can add: echo mysql_error();
This returns:
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /www/zymichost.com/f/r/e/fretwizz/htdocs/calendar_v2/index.php on line 117
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /www/zymichost.com/f/r/e/fretwizz/htdocs/calendar_v2/index.php on line 118
Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /www/zymichost.com/f/r/e/fretwizz/htdocs/calendar_v2/index.php on line 123
No database selected
Steve