| Author |
Topic Search Topic Options
|
rob_andy
Newbie
Joined: 21 February 2003
Location: United Kingdom
Status: Offline
Points: 33
|
Post Options
Thanks(0)
Quote Reply
Topic: Randomise Posted: 16 December 2003 at 2:05am |
I have an asp application that call entries from a database, at the moment each record in the db have a unique numerical ID e.g. 1,2,3 etc... At the moment the application loops through these in order, however, I would like to randomise this so that each time a person uses the app they get a different order with no repeats in a cycle. At the moment the app works by starting with ID = 1 and then reloading the page with ID + 1 each time until the last record. My initial thoughts would be creating a global array but have no idea where to start. Any help is most appreaciated. You can email me using :
This Link
|
 |
MorningZ
Senior Member
Joined: 06 May 2002
Location: United States
Status: Offline
Points: 1793
|
Post Options
Thanks(0)
Quote Reply
Posted: 17 December 2003 at 11:16am |
why would we email? this is a forum to post questions and answers publically so all can give input/learn
as for your solution.. look in the Database forum for threads on retrieving data in random order
|
|
Contribute to the working anarchy we fondly call the Internet
|
 |
pmormr
Senior Member
Joined: 06 January 2003
Location: United States
Status: Offline
Points: 1479
|
Post Options
Thanks(0)
Quote Reply
Posted: 17 December 2003 at 6:02pm |
|
this is a pretty decent random number generator that you can use to get a random record to start with
'Set Randomizer function that returns a pesudo random
'number
Function random ()
RANDOMIZE
Dim randomnum
randomnum = (rnd(1)) * 123456
random = Round(randomnum)
end function
|
|
|
 |
rob_andy
Newbie
Joined: 21 February 2003
Location: United Kingdom
Status: Offline
Points: 33
|
Post Options
Thanks(0)
Quote Reply
Posted: 19 December 2003 at 2:20am |
Thanks very much pmormr, most helpful. I posted this in the ASP discussion forum because I didn't believe it was a database issue, more of an ASP issue. MorningZ, somtimes forums get clutered with useless rubbish when people ask questions etc... In future I will remember your comments, you could have used the link to tell me off and not the forum.
Thanks again.
|
 |
MorningZ
Senior Member
Joined: 06 May 2002
Location: United States
Status: Offline
Points: 1793
|
Post Options
Thanks(0)
Quote Reply
Posted: 19 December 2003 at 5:34am |
rob_andy wrote:
Thanks very much pmormr, most helpful. I posted this in the ASP discussion forum because I didn't believe it was a database issue, more of an ASP issue. MorningZ, somtimes forums get clutered with useless rubbish when people ask questions etc... In future I will remember your comments, you could have used the link to tell me off and not the forum.
Thanks again.
| first off.. my explaination that this was a forum was because of the last bit of your original post, "You can email me using"
as if you were expecting someone to just email you the answer
secondly.. i was trying to help you by telling you their were a few threads in this database on this same exact topic and have answers to your problem on there already!
Sorry if you think that wasn't enough, i wasn't aware i owed you anything... next time i'll do your legwork for you i guess since that is what you expect of me
|
|
Contribute to the working anarchy we fondly call the Internet
|
 |
rob_andy
Newbie
Joined: 21 February 2003
Location: United Kingdom
Status: Offline
Points: 33
|
Post Options
Thanks(0)
Quote Reply
Posted: 22 December 2003 at 8:59am |
What a way to waste peoples time.
|
 |
KCWebMonkey
Senior Member
Go Chiefs!
Joined: 21 June 2002
Status: Offline
Points: 1319
|
Post Options
Thanks(0)
Quote Reply
Posted: 22 December 2003 at 9:27am |
rob_andy wrote:
What a way to waste peoples time.
|
I don't think you should be criticizing MorningZ, he was just trying to help you get the answer you need, without just giving you the answer like a baby needing a bottle.
|
 |
Semikolon
Senior Member
Joined: 09 September 2003
Location: Norway
Status: Offline
Points: 1718
|
Post Options
Thanks(0)
Quote Reply
Posted: 22 December 2003 at 10:54am |
MorningZ is a good asp/asp.net coder.. you should respect him, you may need his help in the future..
and MorningZ is not the one who wastes peoples time, in this topic, it was you that didnt search before you asked..
|
 |