is somthing like that possible?
for ($i = 1; $i <= 15; $i++) {
$var = "bild" . $i;
if (!empty ($row->bild.$i)) {
echo '
<div class="item">
<img border="no" class="bildschatten" src="include/images/projekte/'.$row->bild . $i.'" />
</div>
';
}
}
how should it look correctly? problem is:
I fetch objects from a mysql database, in this table each object has 15 images
bild1 .. bild15
Now I want to iterate over this 15 images and want to check if the colum is empty or not.
the problem I have is here:
$row->bild.$i
that contains not the value of column bild1.. bild15 ... it only contains the value of $i
thanks
$row->$var. for more details check the manual