title: PHP Compare result to high score database returns duplicate values
body: <p>I have a jQuery function that send the result time variable to a php file that compares the result to the database and returns 1 if it is a new highscore.. but for some reason it is returning 111</p>
  
  <p>Here is the PHP:</p>
  
  <pre><code>require_once('db.php');
  
  $sql = "SELECT score FROM highscores ORDER BY score ASC LIMIT 10";
  $result = mysqli_query($con, $sql);
  $score = $_POST['time'];
  
  while($row = mysqli_fetch_array($result)) {
      if($row['score'] &gt; $score) {
          echo 1;
      }
  }
  </code></pre>
  
  <p>and then the jquery function:</p>
  
  <pre><code>jQuery.ajax({
      url:'model/highscore.php',
      type:'POST',
      data: {time:totalTime},
      success:function(result){
          highScore = result;
      }
  });
  </code></pre>
  
  <p>Any Help Greatly Appreciated.</p>