Re: Help with a within week function

From: Date: Mon, 05 Mar 2007 15:56:58 +0000
Subject: Re: Help with a within week function
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-249879@lists.php.net to get a copy of this message
On 3/5/07, Jim Moseby <JMoseby@nrbindustries.com> wrote:
I have been trying to find a way to search a DB and match a range within a week ( php & mysql ). This doesn't make sense, so I will describe it in more detail. Hi everyone, I need help with a search, lets say a record has a date of 2/5/2007 and if someone visits the website between 2/5/07 and 2/11/07 I want to display the record with 2/5/2007. If it's within the week so to speak. Does anyone know how I can accomplish this? (You might get better answers from the MySQL list when asking MySQL questions.) SELECT * from table where record_date between '$begin_date' and '$end_date'; JM
There's probably a solution in here as well: $queryLocation1 = "SELECT mrem_per_hour as Loc1,
                 if((date_time >= DATE_SUB(now(), interval 2 minute)),
                 'display', 'noDisplay') as test
                 FROM   location1
                 ORDER
                 BY     date_time
                 DESC
                 LIMIT 1";
David

« previous php.general (#249879) next »