Forums
This topic is locked
Display real image based on the value from db
Posted 04 Apr 2006 04:00:30
1
has voted
04 Apr 2006 04:00:30 rajna clara posted:
I'm a beginner in PHP and my problem is probably something that everybody knows, but not me. I don't know how to link an image name stored in database with the real image file on the web server. I created a recordset and displyed all fields from database but the image name (it's displyed as a name not as a real image). Could you please help me with this problem? Here is the code in which I'd like to use the value from database to disply the real image on the page:
<?php do { ?>
<tr>
<td><!-- TemplateBeginEditable name="photo" --><?php echo $row_rsimage['IMAGE_NAME1']; ?><!-- TemplateEndEditable --></td>
</tr>
<tr>
<td bordercolor="#FFFFFF"> </td>
</tr>
<?php } while ($row_rsimage = mysql_fetch_assoc($rsimage)); ?>
</table>
Thanks in advance...
Replies
Replied 04 Apr 2006 07:21:32
04 Apr 2006 07:21:32 rajna clara replied:
So no help on this topic. All I need to know how to use '$row_rsimage['IMAGE_NAME1']; ' (recordset) to get the image from the directory and display it on the page? If I have to do this in ASP I would know how to do it, but unfortunately I have to use PHP and there is no help on this idiotic problem on your or any other forum or web - except if you want to buy it - what happend to a open source scripts? ???
I hope somebody on this forum will know how to do this!
I hope somebody on this forum will know how to do this!
Replied 04 Apr 2006 10:09:43
04 Apr 2006 10:09:43 Dave Thomas replied:
where you want your image showing, use 'insert > image> now, choose data sources option than using a file on the drive, this will open up the recordset dialogue
choose the field which holds your image path/s, that's it.
<img src="www.bluecoder.co.uk/dmx/dynamic_image_insert.jpg" border=0>
regards
Dave Thomas
<b>DMX Zone Forums Manager</b>
Tip: Use Google or our own Search function to find answers before asking. You'd be surprised what's already written <img src=../images/dmxzone/forum/icon_smile_wink.gif border=0 align=middle>
choose the field which holds your image path/s, that's it.
<img src="www.bluecoder.co.uk/dmx/dynamic_image_insert.jpg" border=0>
regards
Dave Thomas
<b>DMX Zone Forums Manager</b>
Tip: Use Google or our own Search function to find answers before asking. You'd be surprised what's already written <img src=../images/dmxzone/forum/icon_smile_wink.gif border=0 align=middle>
Replied 04 Apr 2006 12:12:52
04 Apr 2006 12:12:52 Roddy Dairion replied:
As i script most of the time by myself i might not help a lot but as far as i can c in ur script u'r just echoing the image name and not the image itself. May be (and again that just include my point of view) u should insert the link to where the image is pointing. for e.g.
image/<?=$row_rsimage['IMAGE_NAME1']?>
image/<?=$row_rsimage['IMAGE_NAME1']?>