This
mysqli_num_rows($query)
expected
$query
to be a result set, but it turned out to be a boolean false.
PHP: mysqli_result::$num_rows - Manual[
^]. Try improving your code like this:
if (!$query) {
echo("Error description: " . mysqli_error($con));
} else if(mysqli_num_rows($query) == 1){
} else {
echo "invablid username or password";
}