I have the following code
if(mysqli_num_rows($result) > 0)
{
while($row = mysqli_fetch_array($result))
{
$output .= '
<div class="col-md-3">
<div class="single-post">
<img src="img/cars/'.$row["fahrzeugBild"].'.jpg" alt="">
<h4><span class="author-name">Modell: '.$row["fahrzeugName"].'</span></h4>
How is it possible getting $output into If else statement? So if $row is empty it should return nothing.
if(mysqli_num_rows($result) > 0)
{
while($row = mysqli_fetch_array($result))
{
$output .= '
echo <div class="col-md-3">
echo <div class="single-post">
If .$row["fahrzeugBild"] empty then
nothing
else
echo <img src="img/cars/'.$row["fahrzeugBild"].'.jpg" alt="">
If .$row["fahrzeugName"] empty then
nothing
else
echo <h4><span class="author-name">Modell: '.$row["fahrzeugName"].'</span></h4>