MySQL Forums
Forum List  »  PHP

mysql_num_rows(): supplied argument is not a valid MySQL result
Posted by: stef an
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!

Options: ReplyQuote


Subject
Written By
Posted
mysql_num_rows(): supplied argument is not a valid MySQL result
May 14, 2012 07:08AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.