
Best Answer Blimp, 11 December 2014 - 01:08 AM
Hey!
This would probably be best achieved by a random order by. In your query, add this to the end of your query:
ORDER BY RAND()
LIMIT 1
The rand is a method that returns a random row, the LIMIT is the amount of rows that you want to get back. In this case, you want a single row. The end query would be something along the lines of:
SELECT * FROM klients WHERE status=free ORDER BY RAND() LIMIT 1
Go to the full post