Re: [PHP] something about dates in mysql

2011-03-03 Thread Webforlaget.dk
rch 03, 2011 2:13 PM Subject: Re: [PHP] something about dates in mysql On 3 March 2011 12:33, Alex 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 repr

Re: [PHP] something about dates in mysql

2011-03-03 Thread Richard Quadling
On 3 March 2011 12:33, Alex 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 for all intents

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 wrote: > I need help to know Why this dont work ? > > ---

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 Nathan Rixham
Richard Quadling wrote: On 3 March 2011 10:09, Webforlaget.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 s

Re: [PHP] something about dates in mysql

2011-03-03 Thread Richard Quadling
On 3 March 2011 10:09, Webforlaget.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<=$th

[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"; --