Re: RevCMS lottery script
Optimize your querys. They're very badly done. Anways it's nice for those who use revcms, i prefer own bullshit.
Re: RevCMS lottery script
Sorry, I feel its easier to read personally but thanks :)
Re: RevCMS lottery script
Re: RevCMS lottery script
Re: RevCMS lottery script
How can you make someone win? or does it go automaticly?
Re: RevCMS lottery script
Quote:
Originally Posted by
sidney023
How can you make someone win? or does it go automaticly?
Nice question, well it goes into your database and you could pick it randomly. But forget all that if you want me to quickly code something when the submit button is active:
-> Get a random row
-> Send user x amount of credits
-> Empty the table?
Re: RevCMS lottery script
Wow a really nice release to make retros even more unique. Good job.
Re: RevCMS lottery script
Thanks but, answer pm maybe? :S Im having a problem.
Thanks for it tho
Re: RevCMS lottery script
Quote:
Originally Posted by
JNike Rulez
Optimize your querys. They're very badly done. Anways it's nice for those who use revcms, i prefer own bullshit.
http://www.moxtube.com/images/photos...1327793278.jpg
Anyway why did you put this:
Code:
mysql_query($coins,$sql);
In the code?
It's useless and $coins and $sql are both a query resource and not a string or link.
Re: RevCMS lottery script
Quote:
Originally Posted by
joopie
Thanks for spotting & I really don't know why? lmao :P
Updated main post
Re: RevCMS lottery script
Why did you do this?
Code:
// Inserting the values into database, we'll send the header as successful
$sql = mysql_query("INSERT INTO `lottery` SET
`Username` = '" . $_SESSION['user']['username'] . "',
`Figure_1` = '".$Figure_1."',
`Figure_2` = '".$Figure_2."',
`Figure_3` = '".$Figure_3."' ");
You dont insert a row with set values..
You do:
Code:
INSERT INTO `lottery` (`Username`, `Figure_1`, `Figure_2`, `Figure_3`) VALUES ('". mysql_real_escape_string($_SESSION['user']['username']) ."', '" . $Figure_1 . "', '" . $Figure_2 . "', '" . $Figure_3 . "');
Re: RevCMS lottery script
Quote:
Originally Posted by
Divide
Why did you do this?
Code:
// Inserting the values into database, we'll send the header as successful
$sql = mysql_query("INSERT INTO `lottery` SET
`Username` = '" . $_SESSION['user']['username'] . "',
`Figure_1` = '".$Figure_1."',
`Figure_2` = '".$Figure_2."',
`Figure_3` = '".$Figure_3."' ");
You dont insert a row with set values..
You do:
Code:
INSERT INTO `lottery` (`Username`, `Figure_1`, `Figure_2`, `Figure_3`) VALUES ('". mysql_real_escape_string($_SESSION['user']['username']) ."', '" . $Figure_1 . "', '" . $Figure_2 . "', '" . $Figure_3 . "');
Damn nice spotting, added a new page. Thanks btw. :tongue:
Re: RevCMS lottery script
Using $_SESSION['user']['credits'] is a horrible idea, because the sessions credits will always stay the same, you can purchase as many tickets as you like using that.
Re: RevCMS lottery script
Nice, but why is your username stored in the database? What if someone were to buy a 'winning' ticket but before the draw decided to change their name? Maybe store their ID instead? xD