[SOLVED] Retrieving most recent data
Posted: Mon Apr 12, 2004 6:37 pm
Heyo.. have a lil problem with my script:
This code works in PhpMyAdmin, but not in PHP. No errors, no nothin, not even the data.
I'm not sure where the error is, but am I missing something?
Code: Select all
<?php
$sql = " SELECT body, title FROM articles WHERE DAYOFMONTH( NOW( ) - INTERVAL 10 DAY )";
$query = mysql_query($sql);
while($row = mysql_query($query)){
echo $row['title'];
echo $row['body'];
}
?>I'm not sure where the error is, but am I missing something?