I'm developing an Online Store with PHP, so at the productdetails.php
which shows the details of products, I coded this:
if(!empty($pro_colors))
{
echo "
<div class=''>
<h4 class='' style='float:right'> :رنگ <span>*</span></h4>
<select class='select-css'>
";
foreach($pro_colors as $colors)
{
echo "
<option value='$colors'>$colors</option>
";
}
echo "
</select>
</div></br>
";
}
So simply what it should do is that, if any color has been added to the product at db, it has to show the select option and if no color has been added to the db, the select option must not appear!
But when there is not data on db as color, it shows this:
However, my table looks like this:
So please tell me, how should I solve this problem ?!
Aucun commentaire:
Enregistrer un commentaire