Re: something about dates in mysql
| From: | Gerardo Benitez | Date: | Thu, 03 Mar 2011 12:44:51 +0000 |
| Subject: | Re: something about dates in mysql | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-311624@lists.php.net to get a copy of this message | ||
Hi Webforlaget!
$thisdate is today?
$today = date('Y-m-d");
else
why, you dont use $thisdate as:
$thisdate = "$year-$mth-$day" ?
use quotes for $thisdate in sql query.
Regards.
Gerardo
On Thu, Mar 3, 2011 at 7:09 AM, Webforlaget.dk <info@web-forlaget.dk> wrote:
> I need help to know Why this dont work ?
>
> -------------------------------------------------------------
>
> $thisdate =date("Y-m-d",mktime(0,0,0,$mth, $day, $year));
>
> $sql = "SELECT id,case,startdate,enddate FROM table WHERE
> startdate<=$thisdate AND enddate>=$thisdate ORDER BY startdate";
>
> -------------------------------------------------------------
>
> The result should be an array whith open cases at $thisdate, but nothing
> appear.
>
> Is it something about dates in mysql ?
>
> Thanks for any advice.
>
> Best regards,
>
> Venlige hilsner
>
> Rolf Brejner
--
Gerardo Benitez
-------------------------
www.webseficientes.com.ar
Diseño web, programación, Seo