Hi
I have a SELECT query which retrieves data from a mysql database. Within my database I have a small selection of fields, one of which is a 'Date' field.
My question is simply this, How can I get the SELECT query to only retrieve records where the dates are NOT older than say 3 days old. i.e. any record created 4 or more days ago, will not show up on my screen when the query has been run..?
My current query is as follows:
<?php
$SQLQuery = "SELECT libraryid, title, publisher FROM tbllibrarypublications ORDER by libraryid ASC;";
$Result = mysql_query($SQLQuery);
while ($Row = mysql_fetch_array($Result)) {
$libraryid = $Row["libraryid"];
$title = $Row["title"];
$publisher = $Row["publisher"];
echo " <tr>
<td width=\"40%\" height=\"22\" valign=\"top\">$publisher</td>
<td width=\"60%\" valign=\"top\"><A HREF=\"library.php?libid=$libraryid\">$title</A></td>
</tr>\n";
}
mysql_free_result($Result);
?>
If someone could explain how I can go about doing this I would greatly appreciate it.
Thanks In Advance.