RE: [PHP] select based on time/date

From: Date: Tue, 25 Sep 2001 23:24:31 +0000
Subject: RE: [PHP] select based on time/date
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-68791@lists.php.net to get a copy of this message
I plugged your query in and it didn't result in an error - however, it came up with no results even though there should be. This one should have come up but didn't: INSERT INTO logged_in VALUES ( '5', 'b406e68a7cde49534a14f5fd8848006e', 'September 24, 2001, 3:27 pm', ''); -- the fields correspond to the table structure quoted below Thanks again! __________________ Jason Dulberg Extreme MTB http://extreme.nas.net > -----Original Message----- > From: Jack Dempsey [mailto:dempsejn@georgetown.edu] > Sent: September 25, 2001 7:07 PM > To: 'Jason Dulberg'; 'Sheridan Saint-Michel'; php-general@lists.php.net > Subject: RE: [PHP] select based on time/date > > > select * from logged_in where date_add(time_in,interval 1 hour) <= now() > > -jack > > -----Original Message----- > From: Jason Dulberg [mailto:jdulberg@nas.net] > Sent: Tuesday, September 25, 2001 6:08 PM > To: Sheridan Saint-Michel; php-general@lists.php.net > Subject: RE: [PHP] select based on time/date > > I tried basically what you have but I got an error: > > $sql="select * from logged_in where time_in + interval 1 hour <= now()"; > $result = mysql_query($sql); > > If it will help, here's the table structure -- looks like my structure > is > bit different from what I orignally posted: > > CREATE TABLE logged_in ( > id tinyint(4) DEFAULT '0' NOT NULL auto_increment, > session varchar(100) DEFAULT '0' NOT NULL, > time_in varchar(50) NOT NULL, > KEY id (id) > );

« previous php.general (#68791) next »