Please tell me how not to display the number 0 next to the words 0Dar and 0Exchange

<?php $result = mysql_query("SELECT * FROM table_products",$connect); if (mysql_num_rows($result)>0) { $row = mysql_fetch_array($result); do{ if ($row["imagesad"] != "" && file_exists("ph_main/".$row["imagesad"])) { $img_path = 'ph_main/'.$row["imagesad"]; $max_width = 114; $max_height = 114; list($width, $height) = getimagesize($img_path); $ratioh = $max_height/$height; $ratiow = $max_width/$width; $ratio = min($ratioh, $ratiow); $width = intval($ratio*$width); $height = intval($ratio*$height); }else { $img_path = "images/no-image.png"; $width = 110; $height = 200; } echo ' <li> <div class="block-images-grid"> <img src="'.$img_path.'" width="'.$width.'" height="'.$height.'"> </div> <p class="style-title-grid"><a href="">'.$row["title"].'</a></p> <ul class="reviews-and-counts-grid"> <li><img src="images/eye-icon.png"><p>0</p></li> <li><img src="images/comment-icon.png"><p>0</p></li> </ul> <p class="style-price-grid"><strong>'.$row["targeting"].''.$row["darom"].''.$row["obmen"].'</strong></p> <div class="mini-features"> <p>Город:</p> <p>Дата:</p> </div> </li> '; } while ($row = mysql_fetch_array($result)); } ?> 

This is what the end result looks like.

enter image description here

    1 answer 1

    Replace

     .$row["targeting"].''.$row["darom"].''.$row["obmen"]. 

    on

     .(!empty($row["darom"]) ? $row["darom"] : (!empty($row["obmen"]) ? $row["obmen"] : $row["targeting"])). 

    PS But it is better to hire a normal programmer ...

    • Thank you very much, there is no money for a programmer, you would hire :) - Eugene