I am trying to check if a username is already used in tblUsers, but for some reason it returns true, even though it should be false as the number of rows should come back as zero.
$usernamequery = "SELECT COUNT(`userID`) FROM `tblUsers` WHERE `username` = '$username'";
$query = mysqli_query($con, $usernamequery);
$queryarray = mysqli_fetch_array($query, MYSQLI_BOTH);
$queryarrayres = mysqli_num_rows($query);
return ($queryarrayres > 0)?true:false;