MySQL Forums
Forum List  »  PHP

Re: Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource
Posted by: Peter Brawley
Date: June 16, 2009 10:49AM

You forgot to check return results, eg...
if( $result = mysql_query("select * from $tablenews where id_news = '".$id."'")) {
  if( mysql_num_rows( $result ))
    $ress=mysql_fetch_assoc($result); 
    ...
} else {
  ... call mysql_error()
}

PB
http://www.artfulsoftware.com

Options: ReplyQuote




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.