RE: [PHP] How to Compare dates?

From: Date: Thu, 02 Aug 2001 17:01:48 +0000
Subject: RE: [PHP] How to Compare dates?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-60956@lists.php.net to get a copy of this message
it also appears that you're checking for the same thing over and over and over '0' is the same as "0" and 00000000000000 is the same as 0 and "00000000000000" is the same as '00000000000000' try checking for either 0 or "0000-00-00" > -----Original Message----- > From: Tim [mailto:infoz@earthlink.net] > Sent: Thursday, August 02, 2001 12:23 PM > To: Jack Sasportas > Cc: php > Subject: Re: [PHP] How to Compare dates? > > > To my eyeballs, it looks like you have too many closing parenthesis on > all of those examples. > > - Tim > > On 02 Aug 2001 12:08:22 -0400, Jack Sasportas wrote: > > 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')=="00000000000000") ) ) > > { > > if ( ( mysql_result($db_result,$db_record,'order_date')==00000000000000) ) ) { > > -or- > > if ( ( > > > > mysql_result($db_result,$db_record,'order_date')==strtotime("00000000000000")) ) > > ) { > > > > 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 > > > > > > -- > 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 (#60956) next »