When fetching DB I am getting results and everything works to the point where I am getting a price from DB, which is also works, but what I really need to have is if price returned 0 than that "0" should be replace with "P.O.D" instead.
Any help is appreciated.
here is my query code:
$samples = "SELECT * FROM materials, category_price WHERE materials.type = :cat AND materials.supplier = '$supplier' AND materials.category_id = category_price.category_id";
$res = $db->prepare($samples);
$res->execute(array(':cat' => $category));
$count = $res->rowCount();
if($count > 0)
echo "
<section class=\"border mar_t_40\">
";
while ($row = $res -> fetch()){
$postimggranite = $row[image];
$postidgranite = $row[id];
$postname = $row[mat_name];
$folder = $row[type];
$folder = strtolower($folder);
$supplier = strtolower($supplier);
$category_id = $row[category_id];
$price = ("£ ".$row[price]);
print<<<END
<span class="grid white_back mar_l_30">
<h3>$price</h3>
<a class="fancybox" href="$img_path/$folder/$supplier/large/$postimggranite" rel="group[$postidgranite]" title="$postname"><img alt="$row[name]" src="$img_path/$folder/$supplier/small/$postimggranite" width="100" height="100">$postname</a>
</span>
END;
}
echo "<div class=\"clearfloat\"></div></section>";