$result = $SQL->query("select count(*) AS codes_count from gamecodes WHERE gamecode='.$SQL->quote($gamecode).' AND alreadyused='N';")->fetch();
$counts = $result['codes_count'];
echo $counts;
When I run this SQL statement in the database, the return is 1
.
When I execute this SQL statement by PHP the return is 0
.
What's wrong?