RE: [PHP] MySQL Date
| From: | Barajas, Arturo | Date: | Wed, 19 Mar 2003 14:20:56 +0000 |
| Subject: | RE: [PHP] MySQL Date | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-140283@lists.php.net to get a copy of this message | ||
Shaun,
It should be: date("Y-m-d"). MySQL stores the dates as "yyyy-mm-dd", and that
function returns the current date on the format you need.
Check the date() function on the php manual.
--
Un gran saludo/Big regards...
Arturo Barajas, IT/Systems PPG MX (SJDR)
(427) 271-9918, x448
> -----Original Message-----
> From: shaun [mailto:shaun@mania.plus.com]
> Sent: Miercoles, 19 de Marzo de 2003 07:19 a.m.
> To: php-general@lists.php.net
> Subject: [PHP] MySQL Date
>
>
> Hi,
>
> I have a date stored in a table in my MySQL Database using a
> DATE type for
> the column.
>
> How can i compare the date in the table to today
>
> e.g.
>
> $today = mysql_result($result, $i, Booking_Date);
>
> if($today = *HELP*){
> echo "you are booked today";
> }else{
> echo "you are free today";
> }
>
> thanks for your help
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>