I have a PHP script that is for direct calling that checks to see if a key is in the blacklist database. However, no matter what I try, including mysql_num_rows, it always returns that the value does not exist (returns 'OK')...
What am I doing wrong?
<?php
$pin = $_GET['keycode'];
$cn=mysqli_connect('localhost', 'root', 'password', 'serials') or die($cn->connect_error);
$sql = "SELECT keycode FROM blacklist";
$rs = $cn->query($sql) or die(mysqli_error($cn));
while($row = mysqli_fetch_array($rs)){
if ($row[keycode] == $pin) {
echo "BL";
return;
}
}
echo "OK";
$cn->close();
?>