Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Search - Random Result in ASP

Guest
Jul 13, 2011 Jul 13, 2011

hi all..

i already create search page in asp. The SQL command like this (i'm using MSAccess)

SELECT *
FROM tablename
WHERE '' + tableid + '' LIKE %MMColParam%

tha problem is, i do not have any idea to make the result from table will appear Randomly.

Anybody can guide me to solve this problem?

TOPICS
Server side applications
468
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Jul 13, 2011 Jul 13, 2011

Not sure what you mean. Do you want it to select a random tableId?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jul 14, 2011 Jul 14, 2011

yes

example, in tableid i have info like 0ne, two, three, four, five, six

when we search... the result will appear like six, five, one, three, two, four

and other people search will appear two, one, six, four , three, five

Randomly

TQ for reply

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Jul 14, 2011 Jul 14, 2011

I'm not sure how I would go about this. It sounds like you're tying to build a slot machine type game or something. How will the search function - is the a text entry, a drop down, a button, etc?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 14, 2011 Jul 14, 2011
LATEST

You could retrieve the ID's of the search results into an array, and then randomize the array. Here's one technique I found doing a quick search and I really have not dived in to see how good it is - I'm sure you can find more:

http://www.theproblemsite.com/programming/randomize_array.asp

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines