Skip to content

Instantly share code, notes, and snippets.

@Jarvix
Created September 29, 2012 18:36
Show Gist options
  • Save Jarvix/3804846 to your computer and use it in GitHub Desktop.
Save Jarvix/3804846 to your computer and use it in GitHub Desktop.
$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