Good day, i'm new here and did'nt really know what to search for. I have a question about getting certain rows out of a db. I cant put it in a while loop, beacause i would output the HTML over and over again.
Anyway i'll show the code and my question.
<?php
$q = "SELECT * FROM image, pakket
WHERE pakket.pakket_id = image.pakket_id
AND pakket.pakket_id='$packageid'";
$image = $row['img'];
if ($result = mysql_query($q)){
<a href="<?php echo $image; ?>" rel="fancybox-thumb" class="fancybox-thumb"><img width="370" src="<?php echo $image;; ?>" style="border: 1px solid #ccc;" ></a>
<a href="<?php echo $image; ?>" rel="fancybox-thumb" class="fancybox-thumb"><img width="119" src="<?php echo $image; ?>" style="border: 1px solid #ccc;"></a>
<a href="img/screens/1/EO_screen3.jpg" rel="fancybox-thumb" class="fancybox-thumb"><img width="119" src="img/screens/1/EO_screen3.jpg" style="border: 1px solid #ccc;"></a>
<a href="img/screens/1/EO_screen2.jpg" rel="fancybox-thumb" class="fancybox-thumb"><img width="119" src="img/screens/1/EO_screen2.jpg" style="border: 1px solid #ccc;"></a>
}
else {
echo "Afbeeldingen konden niet opgehaald worden.";
}
?>
What i want is to display the right image inside the right piece of HTML. I'm thinking i shoud have a counter which counts the number of rows in the array, but i have no idea how i should handle this.
i apreciate any help.