haibec Posted October 12, 2006 Share Posted October 12, 2006 Hi Guys!I have problem : I have table Lottery include fields: ID,Name,Ticket1,Ticket2,Ticket3 ( With a user have max three ticket). I make a program use for Lottery (with Ticket1,ticket2,ticket3). I user random() function.I Want break up my table folow :I will add 2 field in to my table have name : Ticket and NewID and NewID field is Autocrement. With a user have three ticket .Example : ID Name Ticket1 Ticket2 Ticket3 23 John 001 003 112will Break up: NewID ID Name Ticket 1 23 John 001 2 23 John 003 3 23 John 112And finish : I will dial number in NewID use random() functionPlease help me Link to comment Share on other sites More sharing options...
lordfa9 Posted November 2, 2006 Share Posted November 2, 2006 Hi Guys!I have problem : I have table Lottery include fields: ID,Name,Ticket1,Ticket2,Ticket3 ( With a user have max three ticket). I make a program use for Lottery (with Ticket1,ticket2,ticket3). I user random() function.I Want break up my table folow :I will add 2 field in to my table have name : Ticket and NewID and NewID field is Autocrement. With a user have three ticket .Example : ID Name Ticket1 Ticket2 Ticket3 23 John 001 003 112will Break up: NewID ID Name Ticket 1 23 John 001 2 23 John 003 3 23 John 112And finish : I will dial number in NewID use random() functionPlease help meI don't really understand :/Are you trying to convert your [b]ID Name Ticket1 Ticket2 Ticket3[/b] 23 John 001 003 112 table to this format?-----> [b]NewID ID Name Ticket [/b] 1 23 John 001 2 23 John 003 3 23 John 112 I was also thnking that since you want to do a lottery, world it be better to use the random() function on the ticket number and then using a JOIN to find out who owns the winning ticket? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now