I have codes that players can redeem for in-game goods like currency. These codes are one time codes, once they are used they are inserted into the players MySQL row on my table.
How can I check if a code already exists in a MySQL table's row?
I am not sure how to do this.
<?php
$code = 542345234543;
$query = "SELECT * FROM myTable WHERE token = '$code'";
$database->query($query);
$database->close();
?>