//如果数据表中有代表输入时间的insertdate字段,基本可以实现
//首先取得前两天的日期:
$yesterday=date("Y-m-d H:i:s",strtotime('-1 day'));
$thedaybeforeyesterday=date("Y-m-d H:i:s",strtotime('-2 day'));
$sql=" SELECT * FROM yourtable WHERE insertdate between $yesterday and $thedaybeforeyesterday order by id asc";
SELECT *FROM Table WHERE datediff(now(),'你表里的日期字段')=2