Reputation: 93
I have tried this but not working.
$getPerson = mysqli_query($con,"SELECT * FROM Persons LIMIT 0,15");
shuffle($getPerson)//how to set limit for this?
Upvotes: 1
Views: 70
Reputation: 4207
You can use ORDER BY RAND()
with LIMIT 0,4
SELECT * FROM Persons ORDER BY rand() LIMIT 0,4
Upvotes: 1