rondog Posted January 21, 2008 Share Posted January 21, 2008 I am echoing out a path of an image from my db. My PHP looks like this <?php $build .= "<td rowspan=\"2\"><img src=\"thumbnails\$row[thumbnail]\" title=\"$row[name]\" /></td>"; ?> it outputs in the html <img src="thumbnails$row[thumbnail]" /> where I need it to say "thumbnails\thumb1.jpg" or w/e it may be. I tried playing around with addslashes but the closest I got was thumbnails\' What should I do? Link to comment https://forums.phpfreaks.com/topic/87110-solved-problem-with-backslash/ Share on other sites More sharing options...
marcus Posted January 21, 2008 Share Posted January 21, 2008 $build .= "<td rowspawn=\"2\"><img src=\"thumnails/".$row['thumbnail']."\" title=\"".$row['name']."\"> /></td>\n"; Link to comment https://forums.phpfreaks.com/topic/87110-solved-problem-with-backslash/#findComment-445502 Share on other sites More sharing options...
ratcateme Posted January 21, 2008 Share Posted January 21, 2008 Change your code to this $build .= "<td rowspan=\"2\"><img src=\"thumbnails/$row[thumbnail]\" title=\"$row[name]\" /></td>"; Link to comment https://forums.phpfreaks.com/topic/87110-solved-problem-with-backslash/#findComment-445503 Share on other sites More sharing options...
rondog Posted January 21, 2008 Author Share Posted January 21, 2008 oh how embarrasing..I dont know why I was using a backslash in the first place. Link to comment https://forums.phpfreaks.com/topic/87110-solved-problem-with-backslash/#findComment-445507 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.