Xtremer360 Posted March 1, 2010 Share Posted March 1, 2010 I keep getting this error with this message: Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/content/y/a/n/yankeefaninkc/html/v3/index.php on line 114 <?php //query $query = "SELECT ecn.id AS id, ecn.title AS title, ecn.content AS content, ecn.postdate AS postdate FROM `efed_content_news` AS ecn WHERE ecn.public = '1' AND ecn.category_id = '3' ORDER BY ecn.postdate DESC, ecn.id DESC LIMIT 5"; $result = mysql_query ($query); while($row = mysql_fetch_assoc($result)){ $fieldarray=array('id','content','title','postdate'); foreach ($fieldarray as $fieldlabel){ if (isset($row[$fieldlabel])){ $$fieldlabel=$row[$fieldlabel]; $$fieldlabel=cleanquerydata($$fieldlabel); } } $postdate = convertdate($postdate); if($postdate != $olddate){ if($olddate == ''){ print "<li><strong>".$postdate."</strong><ul>"; } else{ print "</ul></li><li class='date'><strong>".$postdate."</strong><ul>"; } } print "<li><a href='backstage/content.php?p=news&id=".$id."'>".$title."</a></li>"; $olddate = $postdate; } print "</ul></li></ul>"; ?> Link to comment https://forums.phpfreaks.com/topic/193740-not-familiar-with-the-following-error/ Share on other sites More sharing options...
jl5501 Posted March 1, 2010 Share Posted March 1, 2010 it means that your call to mysql_query, failed and did not produce a result. you need to check the response of th call to mysql_query and for now you should change it to $result = mysql_query ($query) or die(mysql_error()); When you have resolved the issue and before this is used in a live environment you need to handle the error in a more sophisticated manner, but this will tell you what is wrong with your query Link to comment https://forums.phpfreaks.com/topic/193740-not-familiar-with-the-following-error/#findComment-1019745 Share on other sites More sharing options...
Xtremer360 Posted March 1, 2010 Author Share Posted March 1, 2010 Okay fixed the issue but now its not showing the dates for headlines and rumors and showing the date for column but showing an error there. http://kansasoutlawwrestling.com/v3/index.php Link to comment https://forums.phpfreaks.com/topic/193740-not-familiar-with-the-following-error/#findComment-1019757 Share on other sites More sharing options...
jl5501 Posted March 1, 2010 Share Posted March 1, 2010 Yes I cannot see anywhere in your code where $olddate is set to anything Link to comment https://forums.phpfreaks.com/topic/193740-not-familiar-with-the-following-error/#findComment-1019760 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.