chicka Posted June 17, 2009 Posted June 17, 2009 Re: [mc code V2]Updated Lottery I have been trying to figure out how to get my players to win the money.. when the lottery is over it says that you have won the weekly lottery and you were credited $0.00 can anyone fix that please?? Quote
Akash Posted June 17, 2009 Author Posted June 17, 2009 Re: [mc code V2]Updated Lottery I have no idea what I can do. I have tested this again on my dev site. Works perfectly for me. Perhaps you've installed something wrong. Apologies. Quote
chicka Posted June 17, 2009 Posted June 17, 2009 Re: [mc code V2]Updated Lottery I tried to re install it and i'm getting the same thing.. i'm not winning anything Quote
Feky Posted June 18, 2009 Posted June 18, 2009 Re: [mc code V2]Updated Lottery yea same here it say i won the jacket pot but dont get the money Quote
Feky Posted June 19, 2009 Posted June 19, 2009 Re: [mc code V2]Updated Lottery fixed it now mine works Quote
chicka Posted June 19, 2009 Posted June 19, 2009 Re: [mc code V2]Updated Lottery feky what was the fix?? Quote
Feky Posted June 19, 2009 Posted June 19, 2009 Re: [mc code V2]Updated Lottery lottery.php You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. cron_weekly.php You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Quote
chicka Posted June 20, 2009 Posted June 20, 2009 Re: [mc code V2]Updated Lottery Query was INSERT INTO `lottery` (id,userid, amount) VALUES (0,1, 1000) I take it my sql is wrong? Quote
kotton1320 Posted June 23, 2009 Posted June 23, 2009 Re: [mc code V2]Updated Lottery Im having a little problem. When u win the lottery it does not credit you the money. Is there anything i could of done wrong ? Quote
jds137 Posted June 25, 2009 Posted June 25, 2009 Re: [mc code V2]Updated Lottery I have 2 errors, will anyone help? You have bought 1 lottery tickets. Go HomeQUERY ERROR: Unknown column 'amount' in 'field list' Query was INSERT INTO `lottery` (id,userid, amount) VALUES (0,2, 1000) QUERY ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'unix_timestamp(),0,'You won the weekly lottery and were credited $')' at line 1 Query was INSERT INTO events VALUES('',,unix_timestamp(),0,'You won the weekly lottery and were credited $') Quote
Feky Posted June 26, 2009 Posted June 26, 2009 Re: [mc code V2]Updated Lottery lottery.php You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. cron_weekly.php You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. add this sql to users table You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Quote
legrolls Posted June 28, 2009 Posted June 28, 2009 Re: [mc code V2]Updated Lottery I was not credited money either... Quote
Feky Posted June 29, 2009 Posted June 29, 2009 Re: [mc code V2]Updated Lottery weird lol it works for me Quote
kaine- Posted November 20, 2009 Posted November 20, 2009 i need help with crons i dont know where to start with them private message me please.. Quote
rulerofzu Posted April 20, 2010 Posted April 20, 2010 Going through the code.... $lotterySQL = sprintf("SELECT * FROM `lottery` WHERE `userID` = %d", abs((int)$userid)); Is wrong. In the table created its set as userid. Not userID so you will need to change that query. In the cron file at the bottom where the winner is credited the money. There is no query its just a sprintf so either make that line a query $creditSQL = mysql_query(sprintf( or add underneath that line mysql_query($creditSQL); and it will now credit the winner. Feky's version is nicer with the form option for buying more tickets at once. Quote
Uridium Posted April 20, 2010 Posted April 20, 2010 Silly question :) If one or more users have mass ammounts of cash and are able to exploit the lottery wouldnt that be unfair. My theory is let a user buy a certain amount of tickets and it wont let them buy anymore until other players have bought some and even then lets say joe bloggs buys 25 more tickets then others are able to buy some coz Joe has reset the ticket sales to 25 so others can buy... Quote
rulerofzu Posted April 20, 2010 Posted April 20, 2010 Make it x amount of tickets done by how many users you have. Maybe something like check who has been online for a week. Grab that number x 5 and let them have a max share of the tickets. For example Say you have 100 users. So total 500 tickets available. Each user has a max of 5 tickets they can purchase. Quote
Andrewelli Posted April 23, 2010 Posted April 23, 2010 works perfect except on line 13 it should be $db->num_rows if anyone gets the not a vaild mysql resource error, only for v2 of course :) Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.