Put your row checking outside of your while
loop and I have changed if($row['license'] > 0)
to if($stmt->rowCount() > 0)
Give this a try now. (Tested on my server)
<?php
sleep(1);
include('connection.php');
if($_REQUEST)
{
try {
$stmt = $conn->prepare('SELECT license FROM users_lic WHERE license = ?');
$stmt->bindParam(1, $_REQUEST['license']);
$stmt->execute();
while($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
}
}
catch(PDOException $e) {
echo 'ERROR: ' . $e->getMessage();
}
if($stmt->rowCount() > 0)
{
echo '<div id="Error">The license is already in our system</div>';
}
else
{
echo '<div id="Success">The license does not exist in our system</div>';
}
}
?>