Monday, April 16, 2012

zend framework images from database

Simply I'm looking to get images from a database displayed on page.

I have the image path saved as a blob in the database and then tried to echo the field in the source property of the img tag. But I get loads of random characters displayed and no image.. Below is what I have in the view of the page I want images displayed:

<div id="club_pictures">
<img id="pic_1" src="<?php echo $this->clubs['pic_1']; ?>" />
<img id="pic_2" src="<?php echo $this->clubs['pic_2']; ?>" />
<img id="pic_3" src="<?php echo $this->clubs['pic_3']; ?>" />

If I then click view source in the browser I get the exact HTML I would want to display the image.



No comments:

Post a Comment