Forum Moderators: coopster
I have a VERY simple situation where I am uploading articles to a database with a simple interface. It specifies date posted, title, summary, content, etc.
I am spitting the articles out onto the home page of the website (only the title and summary) but oddly, it seems to be retrieving old info. Here's the code to retrieve from the MySQL db:
$query = "select * from news_publish
order by datepost desc limit 7 ";
$results=mysql_query($query) or die (mysql_error());
while ($rows=mysql_fetch_array($results)) {
extract ($rows);
echo stripslashes("<b>$title</b>");
echo "<br>";
echo stripslashes($summary);
echo " <a href='http://www.example.org/news1.php?news_id=$rows[news_id]'>";
echo "(more)";
echo "</a>";
echo "<br><br>";
}
It seems like the order by would be sufficient to display the most recent 7 titles.
BUT what is happening is, it's displaying articles that have since been deleted! I have verified that they are no longer in the DB and have refresh, even put a javascript force-refresh on the page.
Is this a cache problem? What might I do to make sure the PHP script goes straigh to the DB for the latest info, without passing go?
Thanks!
[edited by: jatar_k at 6:11 pm (utc) on July 12, 2006]
[edit reason]
[1][edit reason] examplified url [/edit] [/edit][/1]
I would check the db and see what's there. If they are deleted in the table it is supposed to be using then my guess is that it isn't using that table. Testing db maybe still around? or a spare table you were using for a while?
even though phpmyadmin should give you the answer you want if your scripts are connecting to something different than phpmyadmin you won't know. I rely solely on command line when I am looking at things like this. I need to confirm what dbs are there, what tables and what is in those tables/dbs.
I'll keep an eye on it. Thanks for the feedback!
Pat