Created
September 29, 2012 18:36
-
-
Save Jarvix/3804846 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$check = $conn->query("SELECT * FROM `codes` WHERE `code` = '$code' AND `activated` =0") | |
if ($check->num_rows() !== 0) { | |
$info = $check->fetch_array(); | |
$gid = $info['gameid']; | |
if ($conn->query("update `codes` set `activated` =1 WHERE `code` = '$code'") !== false) { | |
echo('<span style="color:green;"Game Activated!</span><br />'); | |
update_purchase($user, $pass, $salt, $gid); | |
} else { | |
echo('Error: '.$conn->error); | |
} | |
} else { | |
echo('Code does not exist or has already been redeemed!<br />'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment