First, for a BETWEEN statement to work, you need to use the lesser value first.
BETWEEN 20 AND 1
returns nothing
Next, when, when, when WHEN will people realize that MySQL provides MUCH, MUCH better date handling than PHP. I can't begin to emphasize how much more ease and flexibility MySQL supports.
SELECT *
FROM mytable
WHERE datefield
BETWEEN CURRENT_DATE()-INTERVAL 1 DAY and CURRENT_DATE
Will do the trick.
If you want to make the date variable:
$mydate='2005-02-27';
$result=mysql_query("
SELECT *
FROM mytable
WHERE datefield
BETWEEN '$mydate'-INTERVAL 1 DAY and '$mydate'");