How to calculate the age of the user inside a SQL query. Be aware I splitted the database into the fields: birthday, birthmonth and birthyear.
I created a fiddle to show what I mean.
CREATE TABLE IF NOT EXISTS `user_profile` (
`user_id` int(11) NOT NULL AUTO_INCREMENT,
`user_birthday` tinyint(4) NOT NULL,
`user_birthmonth` tinyint(4) NOT NULL,
`user_birthyear` smallint(6) NOT NULL,
PRIMARY KEY (`user_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
INSERT INTO `user_profile`
(user_birthday, user_birthmonth, user_birthyear) VALUES (31, 12, 1990)