mysql_num_rows(): supplied argument is not a valid MySQL result
Date: May 14, 2012 07:08AM
Hi,
I'm getting this error in the sidebar:
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/public_html/index.php on line 58
line 58 is:
<?php
$sql = "SELECT s.name AS song_name, s.url AS song_url, s.submit_name, s.submit_time, a.name AS artist_name, a.url AS artist_url FROM song AS s, artist AS a WHERE s.artist_id = a.id ORDER BY s.id DESC LIMIT 20";
$result = runQuery($sql);
while ($row = mysql_fetch_assoc($result)) { <= 58
?>
Also, the results page gives me this at the top:
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/public_html/includes/functions.ssi.php on line 106
line 106 is:
function pagify_results($sql, $letter, $songs) {
$result = runQuery($sql);
if (mysql_num_rows($result)) { <= 106
$per_page = 50;
Does anyone know what is going on?
Thanks in advance!