Personally I'd have expiration date as unix timestamp (integer) or at the very least a date (unix format): Y-m-d.
$now = time();
$sql="SELECT * FROM `$tbl_name` WHERE (`username` ='$myusername' OR `lastname` ='$myusername') AND `password`='$mypassword' AND `expiry` > $now";
BTW - using more than one word for a field can be bothersome
diafol
Keep Smiling
10,662 posts since Oct 2006
Reputation Points: 1,628
Solved Threads: 1,513
Skill Endorsements: 57