Re: How to Compare dates?

From: Date: Thu, 02 Aug 2001 16:08:22 +0000
Subject: Re: How to Compare dates?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-60943@lists.php.net to get a copy of this message
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

« previous php.general (#60943) next »