lottery php code need help

Shaz

Member
Jan 8, 2015
57
1
im currently making a lottery system for my hotel,

is there anyway where i can do a code where its similar to how i want it:
i need it to add up all the number of tickets purchased in the database (lottery_entries) and then calculate the total entries by 2000 credits
and then it shows the amount of credits in total in a the jackpot part on the php page

also i need help on another code where you type (e.g 12345) and it picks the all the same codes from the (lottery_entries) db
and inserts the id, username, code into (lottery_winners) db as ive made a table already where it selects the winner codes from the database

not sure if that makes sense but if your willing to help just send me a message and ill try explain it better
 

JayC

Well-Known Member
Aug 8, 2013
5,505
1,401
Mysql has this great tool that returns the number of rows (or in your case the number of lottery tickets) that have been purchased. You can use that as a variable and times by 2000.. Although an easier way to do it is when the user purchases a ticket just add 2000 to the amount of credits to be won lol...

The second one doesn't make sense
 

Shaz

Member
Jan 8, 2015
57
1
the first part is what i want todo where a user purchases a ticket it adds 2000 to the total in jackpot but im not sure of the code i should be typing
 

Users who are viewing this thread

Top