The Wizzard
01-23-2003, 11:28 PM
Hi everyone!
Lets say I have 6 items in my database.
And I want to randomly select 1 and display it, how would I do this?
justame
01-24-2003, 12:42 AM
wiz...
just a checkout® this link...
http://www.webmasterworld.com/forum47/266.htm
oracleguy
01-24-2003, 12:42 AM
One way I know of using ASP... I'm still not up on all the functions you can do in SQL so there might be a way to do it there.
but here is a asp way:
Randomize
Dim intRandom, strQuery
intRandom=int((rnd*MaxValue)+MinValue)
strQuery="SELECT * FROM mytable WHERE ID='"&intRandom&"';"
Try that.