[PHP] something about dates in mysql

2011-03-03 Thread Webforlaget.dk
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;

Re: [PHP] something about dates in mysql

2011-03-03 Thread Richard Quadling
On 3 March 2011 10:09, Webforlaget.dk i...@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

Re: [PHP] something about dates in mysql

2011-03-03 Thread Nathan Rixham
Richard Quadling wrote: On 3 March 2011 10:09, Webforlaget.dk i...@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

Re: [PHP] something about dates in mysql

2011-03-03 Thread Alex
Just a correction, dates in mysql are not strings by any means, they are stored in 3 bytes (date and time or 8 bytes for datetime) and that's nowhere enough for a string, however the representation of the date is a formatted string, so for all intents and purposes any comparison to a date field

Re: [PHP] something about dates in mysql

2011-03-03 Thread Gerardo Benitez
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 i...@web-forlaget.dk wrote: I need help to know Why this

Re: [PHP] something about dates in mysql

2011-03-03 Thread Richard Quadling
On 3 March 2011 12:33, Alex niks...@gmail.com wrote: Just a correction, dates in mysql are not strings by any means, they are stored in 3 bytes (date and time or 8 bytes for datetime) and that's nowhere enough for a string, however the representation of the date is a formatted string, so

Re: [PHP] something about dates in mysql

2011-03-03 Thread Webforlaget.dk
@lists.php.net Sent: Thursday, March 03, 2011 2:13 PM Subject: Re: [PHP] something about dates in mysql On 3 March 2011 12:33, Alex niks...@gmail.com wrote: Just a correction, dates in mysql are not strings by any means, they are stored in 3 bytes (date and time or 8 bytes for datetime