idgeit Posted March 2, 2007 Share Posted March 2, 2007 Hey all, I'm trying to insert the image src from a a database, I have the link coming in as $product_pic can anyone tell me how to put that into HTML? A shot in the dark so far, <img src="<?php $echo $product_pic; ?>" height = "40" width = "40"></a> Any help would be great!, ~ Idgeit Link to comment https://forums.phpfreaks.com/topic/40905-img-src-from-mysql/ Share on other sites More sharing options...
Adika Posted March 2, 2007 Share Posted March 2, 2007 Hi! First mistake: dont put "$" before "echo". The link is good if "$product_pic" is some path/to/file or the filename. What value have "$product_pic"? All the best, Adika Link to comment https://forums.phpfreaks.com/topic/40905-img-src-from-mysql/#findComment-198113 Share on other sites More sharing options...
hellouthere Posted March 2, 2007 Share Posted March 2, 2007 i would use... <?php $product_img = "<img src=$product_pic height=40 width=40>"; echo $product_img; ?> or <img src= <?php echo $product_pic; ?> height="40" width="40"> Link to comment https://forums.phpfreaks.com/topic/40905-img-src-from-mysql/#findComment-198117 Share on other sites More sharing options...
idgeit Posted March 3, 2007 Author Share Posted March 3, 2007 it worked great!, thanks for all the help Link to comment https://forums.phpfreaks.com/topic/40905-img-src-from-mysql/#findComment-198672 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.