【发布时间】:2015-07-18 10:21:27
【问题描述】:
我在 PHP、MYSQL 中有一个应用程序,其中我有个人数据库 他们的出生日期记录在 生日列作为 DATETIME 条目。
我想知道如何按年龄列出个人资料? 例如如果我只想列出年龄在 27 到 31 岁之间的人 生日日期时间 我有一个这样的表单发布数据
$_POST['age_from'];//say 27
$_POST['age_upto'];// say 31
SQL 查询会是什么样子?
@mysql_query("Select * from persons where age is ");
// but I don't have age column
// What are possibilities without adding age column?
// IF I add age column then How to automatically update it
【问题讨论】: