I want to make a query that will select a random row from a table that has the start date + time less than the current date.
This is what I have so far:
$query="SELECT * FROM premium
WHERE
DATE_SUB(CURDATE(),INTERVAL 30 DAY) <= start_date
ORDER BY
RAND() LIMIT 1 ";
I want to replace 30 with the value from the time column for each row.
How can I acces the time value for each row inside the query? (inside the interval)
Or if your column is named
timedoDon’t forget to put backticks
`around time, becausetimeis a reserved word.