Get random rows from a database
I would like to recall 5 random and unique rows from a database.
I have my database, its connected, am getting results from a 'where', but would like to display on a page 5 random results.
Catch up wih the Appery.io community on our forum. Here you'll find information on the lastest questions and issues Appery.io developers are discussing.
https://forum.appery.io/
I would like to recall 5 random and unique rows from a database.
I have my database, its connected, am getting results from a 'where', but would like to display on a page 5 random results.
Hi Brett,
You can not do it with single request.
So only way - is to create server code. That's will fetch elements from the collection and shuffle them and return needed array.
Then you can use this server code in your app.
More info about server code here: http://devcenter.appery.io/documentat...
Tutorial:
http://devcenter.appery.io/tutorials/...
Regards.