MySQL Forums
Forum List  »  PHP

Re: Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource
Posted by: Adrian Danciu
Date: June 16, 2009 03:55AM

Hello,

I have a similar problem and although I've been trying everything, I don't know where the mistake is.
Here is the code I use and the error I get:

<?php
$result=mysql_query("select * from $tablenews where id_news = '".$id."'");
$ress=mysql_fetch_assoc($result);

?>
<? if ($ress['title_news'] != '') { ?><h1><?=$ress['title_news']?></h1><BR><? } ?>
<? if ($ress['text_news'] != '') { ?><?=$ress['text_news']?><BR><? } ?>

<?php

The error I get is: Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /news1.php on line 125"
this line contains: $ress=mysql_fetch_assoc($result);


Any ideas, please? Thanks in advance

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.