I have mysql DB with tables, of which in one table I have a date type field, I want the most recent past date - so I want it to order by date, in descending order, but record only records until today, and then use only the top with the LIMIT function, and also add a WHERE clause in what the clause should be for the selected city.
$result = mysql_query(" SELECT * FROM offers WHERE city = ".$_SESSION["city"]." ORDER BY exp_date DESC LIMIT 0, 1");
source share