0) { if (mysqli_fetch_array($query)['scores'] < $score ) { $query = "UPDATE `bestscores` SET `scores`=".$score." WHERE `userid`=".$uid; mysqli_query($conn, $query); } } else { $query = "INSERT INTO `bestscores` (`userid`, `scores`) VALUES (".$uid.", ".$score.")"; mysqli_query($conn, $query); } echo ""; mysqli_close($conn); ?>