Q:

echo something when no results where found using sql LIKE

I made a search box on my website and searching works fine. But when I type in a random string that can't be found in my database (in which I'm searching) a blank page is displayed. How can I display something like "no matches found" instead? This is the code I'm using:
$search = $_GET["zoek"];
$result = mysqli_query($con,"SELECT Afbeelding,Product,Prijs,Beschrijving FROM Producten WHERE Product LIKE '%$search%' order by Product ASC LIMIT 0, 5");
    echo '<table border="1px solid black" cellspacing="0" style="margin-top:47px"><tbody>';
    while($row = mysqli_fetch_array($result))
    { 
    echo "<tr>";
    echo "<td rowspan='2' width= '200'><img src='" . $row['Afbeelding'] . "' width= '200' height='250'></td>";
    echo "<td><b>" . $row['Product'] . "</b></td>";
    echo "</tr>";
    echo "<tr>";
    echo "<td>" . $row['Beschrijving'] . "&nbsp;<i>Prijs: &euro;&nbsp;" . $row['Prijs'] . "</i><br/><br/></td>";
    echo "</tr>";

    }

    echo "</tbody></table>";

A:

Just ask, how many results this query returns with mysqli_num_rows():
$result = mysqli_query($con,"SELECT Afbeelding,Product,Prijs,Beschrijving FROM Producten WHERE Product LIKE '%$search%' order by Product ASC LIMIT 0, 5");

if(mysqli_num_rows($result) > 0) {
    echo '<table border="1px solid black" cellspacing="0" style="margin-top:47px"><tbody>';
    while($row = mysqli_fetch_array($result))
    { 
    echo "<tr>";
    echo "<td rowspan='2' width= '200'><img src='" . $row['Afbeelding'] . "' width= '200' height='250'></td>";
    echo "<td><b>" . $row['Product'] . "</b></td>";
    echo "</tr>";
    echo "<tr>";
    echo "<td>" . $row['Beschrijving'] . "&nbsp;<i>Prijs: &euro;&nbsp;" . $row['Prijs'] . "</i><br/><br/></td>";
    echo "</tr>";

    }

    echo "</tbody></table>";
} else {
    echo "No matches found";
}

