Re: Re: using date as an "id" field...

From: Date: Mon, 08 Oct 2001 18:05:07 +0000
Subject: Re: Re: using date as an "id" field...
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-70525@lists.php.net to get a copy of this message
On Tue, 09 Oct 2001 12:53:53 +1000, sc wrote: >Thanks for the response but it doesn't seem to work for me... >This is todays date reference: 2001-10-09 >And this is meant to be the previous entry in the sql database: >1999-11-29 to get the row with the previous date use something like: select * from table where day<$today order by day desc limit 1; to select the row with yesterday's date try this: select * from table where day=date_add(curdate(), interval -1 day); >In article <20011008101141.59851.qmail@pb1.pair.com>, "Piotr >Martyniak" ><martynia@box43.gnet.pl> wrote: > >> use: >> ereg("([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})", $your_data, >>$numbers); >> $day_before = mktime(0, 0, 0, $numbers[2], $numbers[3], >>$numbers[1]) - >> 24 >> * 3600; >> $new_date = date("Y/n/j", $day_before); >> should work natur >> >> > -- Mark, maggelet@mminternet.com on 10/08/2001

« previous php.general (#70525) next »