cordoprod Posted February 7, 2009 Share Posted February 7, 2009 Hello. I have an issue with my search page. I always use timestamps from time(). And when the user register, his birthday will be converted to timestamp. But in my search page i have FROM AGE and TO AGE. I get the age from a user like this: // finne alderen function alder($timestamp) { $ageTime = $timestamp; $t = time(); $age = ($ageTime < 0) ? ( $t + ($ageTime * -1) ) : $t - $ageTime; $year = 60 * 60 * 24 * 365; $ageYears = $age / $year; return floor($ageYears); } But how does the sql query look like if that is from timestamp and the ages in select is from 0 to 90? Link to comment https://forums.phpfreaks.com/topic/144223-timestamp-mysql/ Share on other sites More sharing options...
cordoprod Posted February 7, 2009 Author Share Posted February 7, 2009 anyone? Link to comment https://forums.phpfreaks.com/topic/144223-timestamp-mysql/#findComment-756882 Share on other sites More sharing options...
Mchl Posted February 7, 2009 Share Posted February 7, 2009 As I understand, the birthdate is stored as integer timestamp, not as MySQL TIMESTAMP column? Link to comment https://forums.phpfreaks.com/topic/144223-timestamp-mysql/#findComment-757006 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.