i have this code which reads off a database what i would like to do is display an image after each line if i put a folder on server called pics put all pics in the folder pics named 1,2,3 etc how do i call each one and display it $result = mysql_query("SELECT * FROM exchange"); echo "<table border='1'align=center> <tr> <p align='center' class='bodytext'> <th>park-name</th> <p align='center' class='bodytext'> <th>park-location</th> <p align='center' class='bodytext'> <th>caravan-details</th> </tr>";while($row = mysql_fetch_array($result)) { echo "<tr>"; echo "<td>" . $row['parkname'] . "</td>"; echo "<td>" . $row['parklocation'] . "</td>"; echo "<td>" . $row['caravandetails'] . "</td>"; echo "</tr>"; } echo "</table>";mysql_close($con); PHP: cheers Doug
how do the pictures differentiate themselves from eachother with numbers in the first place ?? seeing the output of that page and a link to the folder of images might explain it better than words can.
You would need to get PHP to write a HTML img tag: echo '<img src="' . $imgURL . '" />'; PHP: Where $imgURL is the path to your image ("pics/1.jpg" or whatever you are calling them). Also don't forget alt/width/height in the img tag if you want them.
well, if the pics name is like you said, then you can try this. $count=0; while($row = mysql_fetch_array($result)) { $count++; echo "<tr>"; echo "<td><img src='pics/$count.jpg'></td>"; echo "<td>" . $row['parkname'] . "</td>"; echo "<td>" . $row['parklocation'] . "</td>"; echo "<td>" . $row['caravandetails'] . "</td>"; echo "</tr>"; } echo "</table>"; mysql_close($con); PHP:
this is what i have but pics dont show any ideas cheers Doug <p align='center' class='bodytext'> <th>caravan-details</th> $count=0; </tr>";while($row = mysql_fetch_array($result)) { $count++; echo "<tr>"; echo "<td>" . $row['name'] . "</td>"; echo "<td>" . $row['email'] . "</td>"; echo "<td>" . $row['parkname'] . "</td>"; echo "<td>" . $row['parklocation'] . "</td>"; echo "<td>" . $row['caravandetails'] . "</td>"; echo "<td><img src='pics/$count.jpg'></td>"; echo "</tr>"; } echo "</table>"; PHP: where it says pics/$count.jpeg should the word pic be in there some where