处理错误报告

I am new in PHP so I have to apologize for such a dumb question, but I am not sure how to find the right answer. I should check if my final result is empty (if $sql found anything). If it didnt find I would like to get some notification example "The list is empty". That message will also be visible from Android app when I call the url?

<?php
$host = ""; 
$user = ""; 
$pwd = ""; 
$db = ""; 

$con = mysqli_connect($host, $user, $pwd, $db);

if(mysqli_connect_errno($con)) {
    die("Failed to connect to MySQL: " . mysqli_connect_error());
} 

// query the application data

$sql = "SELECT * FROM lista WHERE Grad='".$_GET['grad']."' AND Predmet='".$_GET['predmet']."'";

$result = mysqli_query($con, $sql);

$rows = array();

while($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) {


        $rows[] = $row;     
}

mysqli_close($con);

echo json_encode($rows);

If mysqli_num_rows returns 0, you have no records.

$result = mysqli_query($con, $sql);
if (mysqli_num_rows($result) == 0) {
    $rows = "no rows found";
} else {
    $rows = array();
    while($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) {
        $rows[] = $row;     
    }
}
mysqli_close($con);
echo json_encode($rows);