date comparison
| From: | Jacky@lilst | Date: | Mon, 15 Jan 2001 18:00:05 +0000 |
| Subject: | date comparison | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-34562@lists.php.net to get a copy of this message | ||
Greeting all,
Just now I asked about to tie string values together and would like to thank
Jason for that. Anyway one more thing, after I have tied string values
together and assigned that to a virables. can I used the value from that
variables to compare with another date value? Say another date value I will
use is also retrieved from a field in table which is in Date data type as
well. So it will be like
$query = "select myBirthdate from date where userId='1' ";
$dateResult =mysql_query($query);
$myBirthDate = (mysql_result($dateResult,0,"myBirthdate"));
$thisBirthdate = "$year"."$month"."$day";
if ($thisBirthdate < $myBirthdate) {
do something
} else {
do some other thing
}
Is it the correct way to do that?
cheers
Jack
jacky@activelifestyle.com
"There is nothing more rewarding than reaching the goal you set for
yourself"