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? Quote 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"; Quote 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>"; Quote 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. Quote Link to comment https://forums.phpfreaks.com/topic/87110-solved-problem-with-backslash/#findComment-445507 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.