Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Banner exchange > random id

Status
Not open for further replies.

snowboardr

Programmer
Feb 22, 2002
1,401
PH
database: mysql

I am making a banner exchange app, how would I get a random id? I know you can't put all ids in a string, because there could be 10000's of users..

my sql statment is this: I am selecting from all users that are in the correct category, and have enough credits, and excludes there account..

strSQL = &quot;SELECT FROM ebanner WHERE bank > 0 AND bCat=&quot; & sMyCat & &quot; sMyID<>&quot; & sMyID

Thanks for any help you can provide.
I'll surely give a start to whoever can help me get a solution for this.
www.vzio.com
star.gif
/ [wink]
 
As I understand from your firts sentence you want to genererate a random but unique ID?

You can play with SessionID and the current time:

MyId = cstr(DateDiff(&quot;s&quot;,&quot;1/1/02 00:00&quot;,now())) & cstr(session.sessionID)

If the server time doesn't change, it's impossible to have a same ID ever.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top