>I am trying to show the records created from the previous day. How can I
make it show the date before today? My date field is like 2001-01-24
16:13:51. Below shows the current day...
>
>
>$FileDate = date ("Y-m-d");
>
>$connection = mysql_connect ("localhost", "*****", "******");
>if ($connection == false){
>  echo mysql_errno().": ".mysql_error()."<BR>";
>  exit;
>}
>
>$query = "select * from warbirds_db WHERE FileDate LIKE '%$FileDate%' ORDER
BY FileID DESC";
>$result = mysql_db_query ("combatfs", $query);

Might be easier/better to use MySQL's date_add() and/or date_format() or
whatever they called it.
http://mysql.org

You'll just do:

$query = "select ... where date_format("Y-m-d", FileDate) =
date_format("Y-m-d", date_sub(now(), '1 day'))";

Only odds are really got I got the function names/syntax wrong since I don't
use MySQL.

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to