Brett C
Posts: 0
Joined: Thu Feb 05, 2015 2:00 am

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.

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Get random rows from a database

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.

Return to “Issues”