Hi what is this error mean Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /homeaddress... line 20..etc. Thanks advance
It means that you haven't provided a $result variable from a previous query. Can you paste a few lines from your script at about that point?
probably the query syntax is incorrect, do or die(mysql_error()) on the ends of anyting mysql to find out....
change $qresult = mysql_query("SELECT * FROM t_media WHERE m_type='".$type."' AND m_submapproved='Y' ORDER BY m_id DESC LIMIT $mediaLimit"); Code (markup): to $sql = "SELECT * FROM t_media WHERE m_type='".$type."' AND m_submapproved='Y' ORDER BY m_id DESC LIMIT $mediaLimit"; echo $sql; exit; $qresult = mysql_query($sql); Code (markup): then paste the line it echoes.....
Also, do check whether or not $qresult is actually not null. I would usually put: if ($qresult!=null) { //work with the result //final cleanup - release memory mysql_free_result($qresult); }