Page 1 of 1

Get random rows from a database

Posted: Thu Feb 05, 2015 2:00 am
by Brett C

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.


Get random rows from a database

Posted: Thu Feb 05, 2015 4:53 am
by Yurii Orishchuk

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.