Hello,
I am getting a strange error when trying to run a query for my site. The database connection info, table, and fields are all correct and I have a sample row of data in the table.
However, I get this error everytime I load the page:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/pinemind/public_html/newsClass.php on line 31
Here is the php code I use to access the db:
Code:function displayNews($numupdates = 5) { $max_news = $numupdates; $host = "localhost"; $user = "pinemind_admin"; $pw = "**"; global $d; $d = mysql_pconnect($host,$user,$pw); mysql_select_db("pinemind_pinemind",$d); $query = "SELECT headline,updatetext,DATE_FORMAT(postdate, '%Y-%m-%d') as date FROM news ORDER BY postdate DESC LIMIT $max_news"; $result = mysql_query($query); while ($row = mysql_fetch_array($result)) { $date = $row['date']; $headline = htmlentities($row['headline']); $updatetext = nl2br(strip_tags ($row['updatetext'], '<a><b><i><u>')); echo "<div id=\"news\">\n"; echo "<h5>$headline :$date</h5>\n"; echo "<p>$updatetext</p>\n"; echo "<p class=\"sig\"><a class=\"sig\" href=\"mailto:jbbarrens@pinemind.com\">Justin</a></p>\n"; echo "</div>\n"; } }
Here is a link to the site
Don't mind the layout . . . a thread I posted in the CSS forum is waiting to be answered, hopefully . ..
Thanks in advance for any insight!
Justin







Bookmarks