php warning mysql_fetch_assoc

Posted by death the kid on Stack Overflow See other posts from Stack Overflow or by death the kid
Published on 2009-12-14T15:12:46Z Indexed on 2010/03/29 2:43 UTC
Read the original article Hit count: 381

Filed under:
|
|

I am trying to access some information from mysql, but am getting the warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource for the second line of code below, any help would be much appreciated.

$musicfiles=getmusicfiles($records['m_id']);
$mus=mysql_fetch_assoc($musicfiles);
for($j=0;$j<2;$j++)
{
 if(file_exists($mus['musicpath']))
 {
  echo '<a href="'.$mus['musicpath'].'">'.$mus['musicname'].'</a>'; 	  
 }
 else
 {
  echo 'Hello world';     
 }
}

function getmusicfiles($m_id)
{
$music="select * from music WHERE itemid=".$s_id;
$result=getQuery($music,$l);
return $result;
}

© Stack Overflow or respective owner

Related posts about php

Related posts about mysql