RE: [PHP] How to Compare dates?

From: Date: Thu, 02 Aug 2001 16:51:41 +0000
Subject: RE: [PHP] How to Compare dates?
Groups: php.general 
Request: Send a blank email to php-general+get-60951@lists.php.net to get a copy of this message
3 left parens, 4 right parens. Kirk > -----Original Message----- > From: Jack Sasportas [mailto:jack@innovativeinternet.com] > Sent: Thursday, August 02, 2001 10:08 AM > To: php > Subject: Re: [PHP] How to Compare dates? > > > OK I actually tried several things prior to the post, here > are some of them and > the errors > > if ( ( mysql_result($db_result,$db_record,'order_date')==0) ) ) { > if ( ( mysql_result($db_result,$db_record,'order_date')=="0") ) ) { > if ( ( mysql_result($db_result,$db_record,'order_date')=='0') ) ) { > -or- > if ( ( > mysql_result($db_result,$db_record,'order_date')=="00000000000 > 000") ) ) > { > if ( ( > mysql_result($db_result,$db_record,'order_date')==000000000000 > 00) ) ) { > -or- > if ( ( > mysql_result($db_result,$db_record,'order_date')==strtotime("0 > 0000000000000")) ) > ) { > > Parse error is the result in all these attempts...with > quotes, single or double, > no quotes, zero or multiple zeros...by the way the timestamp > returns all those > zeros so I was being specific.... > > Any ideas ? > > Thanks ! > > > > > > "Johnson, Kirk" wrote: > > > > Can someone tell me how to properly compare the value > > > returned from the > > > db to see if it is blank ? > > > > > if ( ( > > > mysql_result($db_result,$db_record,'order_date')=00000000000000) > > > ) ) { > > > > Two things, Jack. Enclose 00000000000000 in quotes, since > it is a string, > > but more importantly, use '==' instead of '=' for > comparison. I hate it when > > I do that :) > > > > Kirk > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > > For additional commands, e-mail: php-general-help@lists.php.net > > To contact the list administrators, e-mail: > php-list-admin@lists.php.net > > -- > ___________________________________________________________ > Jack Sasportas > Innovative Internet Solutions > Phone 305.665.2500 > Fax 305.665.2551 > www.innovativeinternet.com > www.web56.net > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: > php-list-admin@lists.php.net >

« previous php.general (#60951) next »