Jeg vil vædde på, at dette er, hvad du leder efter:
SELECT * FROM mytable
WHERE TIMESTAMPDIFF(YEAR, mytable.birthday,'$currentTime') > '$ageFromForm';
For at sortere dataene skal du udføre dette:
SELECT *, (TIMESTAMPDIFF(YEAR, mytable.birthday, '$currentTime')) AS age
FROM mytable WHERE TIMESTAMPDIFF(YEAR,'$birthday','$currentTime') > '$ageFromForm'
ORDER BY age;
Jeg håber dette hjælper;)slavisk