Re: Pulling record by time of day

From: Date: Mon, 04 Mar 2002 04:04:18 +0000
Subject: Re: Pulling record by time of day
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-17437@lists.php.net to get a copy of this message
try this: if (900<=$time && $time<=1500) {$time = 1;} olinux --- mike@wkla.com wrote: > Hello, > > I've been working on pulling one or more records > from my db by the time of > day. Here is what I've tried so far, > <? > $time = date("Hi"); > if (900<=$time<=1500) {$time = 1;} > ?> > I would then use $time in a query like this, > $result = mysql_query("SELECT * FROM table WHERE > id= $time",$db); > > But I can't get the IF statement to work, I've tried > several different > variations. All I get is parse errors. I not sure > how to add the second <=. > When I do this, > if (900<=$time) {$time = 1;} > it works. > > Thanks in advance for the help, > > Mike > > > --- > Outgoing mail is certified Virus Free. > Checked by AVG anti-virus system > (http://www.grisoft.com). > Version: 6.0.319 / Virus Database: 178 - Release > Date: 1/28/02 > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > __________________________________________________ Do You Yahoo!? Yahoo! Sports - sign up for Fantasy Baseball http://sports.yahoo.com

« previous php.db (#17437) next »