Displaying an image using echo command


Posted on 16th Feb 2014 07:03 pm by admin

I had done a query on my database, one of the fields being an image reference to a directory where an image is stored. e.g "/images/picture.jpg"

I want to display this image by using <img src= etc...> in the echo statement but am failing to get a result as i am unsure where to place " or '.

Did you know?Explore Trending and Topic pages for more stories like this.
Can you help?

Heres my code:

while($row = mysql_fetch_array($result))

{

echo "<tr class='d0' valign='top'>";
echo "<td width='200'>" "<img src="'. $row['image_url'] .'.jpg>"" "</td>";
echo "<td class='large' width='300'>" . $row['title'] . "</td>";
echo "<td class='medium' width='100'>" . $row['date'] . "</td>";
echo "<td>" . $row['content'] . "</td>";

echo "</tr>";
}

I know ive probably made an obvious mistake but im new to PHP.

Thanks
No comments posted yet

Your Answer:

Login to answer
179 Like 18 Dislike
Previous forums Next forums
Other forums

Populate drop down list from table??
Lets say for arguments sake that i have a table which contains the numbers 1 to 10.
How can i get

Display thumbnails as square while retaining aspect ratio
I am trying to figure out a way to make an image display as a square, for example 80x80 pixels, when

check comment for html
hi, I just wanted to check if a comment a user posts contains HTML, and if it does, to not allow it

for loop without same $i digits?
Hi,

Can some guru please advise how can I accomplish this with a simple for loop ?

I

C problem struct and string
Hi guys,

This is my first post and I'm hoping the experts here can help me solve my problem.<

Basic Question about Threading and PHP...
I have a page that I am working on and it is taking several hours to process. The basics of what th

Problem with PHP/mySQL login code
Hello,

There is an error in my login script and I can't figure out what it is...
I believe

Data Function is Its Not working IN IE8
This is my first time to use formums. I hope i can get solution for this problem. view plaincopy to

How to secure my login data to my database?
Hi there,

It may be a stupid question but I don't know how to secure my login data to my data

simplexml_load_file and rss problem
Hi,

I have a problem parsing an rss feed using simplexml_load_file - this is strange as i hav

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash