In what scenarios would it be appropriate to display expired auctions for only 2-3 weeks?
Displaying expired auctions for only 2-3 weeks could be appropriate in scenarios where the items being auctioned are time-sensitive or have a high turnover rate. This can help keep the auction platform fresh and relevant to users, as well as create a sense of urgency for potential buyers to make a purchase.
// Display expired auctions for only 2-3 weeks
$expired_date = date('Y-m-d', strtotime('-3 weeks'));
$query = "SELECT * FROM auctions WHERE end_date <= '$expired_date'";
$result = mysqli_query($connection, $query);
// Display the expired auctions
while($row = mysqli_fetch_assoc($result)) {
// Display the auction details
}