I have a mysql table with names. Some events are presented. I want to randomly display one of the last two recognized events. The field timestamp contains the UNIX timestamp for the time the event was generated.
Now the request is as follows:
$query = "SELECT * FROM events WHERE featured = 1 ORDER BY timestamp DESC LIMIT 2;";
Is there a way to query syntax to return only one of these two events and display it right away, or do I need to get around it with php?
What is recommended here?
source share