It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming PHP and MySQL Forum

Pick a Random name

Moderator: Malcolm

Pick a Random name

Postby jberry on Thu Sep 13, 2007 5:41 pm

I have a website and people sign up to receive e-mails and to make purchases. Is there away that I can put some code in and randomly pick a member to win a prize every month. If anyone can help that would be great.
jberry
100+ Club
 
Posts: 144
Joined: Mon Mar 19, 2007 4:40 pm
Location: Atlantic City, NJ

Postby flabbyrabbit on Thu Sep 13, 2007 7:13 pm

How do you store the members email addresses?? If its in a database then you could simply create a random number and then that entry would win.

Flabby Rabbit
Image
User avatar
flabbyrabbit
500+ Club
 
Posts: 706
Joined: Thu Jan 25, 2007 1:10 pm
Location: Midlands, England

Postby jberry on Thu Sep 13, 2007 7:14 pm

Yes I Have it stored in a database. So How would I do it???
jberry
100+ Club
 
Posts: 144
Joined: Mon Mar 19, 2007 4:40 pm
Location: Atlantic City, NJ

Postby flabbyrabbit on Thu Sep 13, 2007 8:36 pm

What type of database you using?? Do you know how to select an entry from that database?? If so can you post the code and I will show you how to modify it.

Flabby Rabbit
Image
User avatar
flabbyrabbit
500+ Club
 
Posts: 706
Joined: Thu Jan 25, 2007 1:10 pm
Location: Midlands, England

Postby litebulb1 on Fri Sep 28, 2007 2:18 am

you can count the database to see how many records there are then randomly chose a number between 0 and that number. that number will be the winner at that record number.
litebulb1
 
Posts: 21
Joined: Thu Sep 27, 2007 11:10 pm

Postby jberry on Fri Sep 28, 2007 11:31 am

Thank you all for the response it helped ne work it out and get it done. Thank you
jberry
100+ Club
 
Posts: 144
Joined: Mon Mar 19, 2007 4:40 pm
Location: Atlantic City, NJ


Who is online

Users browsing this forum: No registered users and 0 guests