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.";
}

?>

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.