What’s the best way to run a mysql query to delete a row if it equals the date in the expire column?
This is my current code:
$sql = "DELETE * FROM table WHERE DATE(expire) = CURDATE()";
$q = $conn->prepare($sql) or die("failed!");
// Bind the params to the placeholders
$q->execute();
Would this work?
EDIT: As Greg said, I don’t really see anything wrong with your current code. The code I provided might be a little more of a guarantee that your table is properly cleaned up.