Jump to content

[SOLVED] Anything wrong with this MYSQL Query?


Aureole

Recommended Posts

It looks fine to me, but it isn't returning any results but there are results in the database.

 

I do connect to the database but that's earlier on in the page...just so you know.

<?php

$query = "SELECT wnewsstoryid, wnewstitle, wnewsshortstory, wnewsfullstory, wnewsauthor, wnewscategory, wnewsmemberid, DATE_FORMAT(date, '%d %M, %Y') FROM news ORDER BY date DESC";

$result = @mysql_query($query);

if (mysql_num_rows($result)>0) {
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
echo "<a href=\"http://www.veraci7y.net/news/read.php?id=";
echo $row['wnewsstoryid'];
echo "\" target=\"_blank\" title=\"Read full story...\" class=\"newstitle\">";
echo $row['wnewstitle'];
echo "</a>";
echo "<p class=\"newsinfo\">Posted by <a href=\"http://www.veraci7y.net/forums/index.php?showuser=";
echo $row['wnewsmemberid'];
echo "\" class=\"user\" title=\"View Member's Profile\">";
echo $row['wnewsauthor'];
echo "</a></p>";
echo "<p class=\"newscontent\">";
echo $row['wnewsshortstory'];
echo "</p><br />";
}
} else {
echo "There are no news posts to display.";
}

?>

Ok this is getting annoying now...

 

If you go to www.veraci7y.net/test.php ...you will see the query is working fine.

 

Now go go www.veraci7y.net/index.php click on the "Misc" in the left column.

 

It's the EXACT same code, it works on test.php but not on index.php...what gives?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.