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 '.

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

Where do I put CRON code
So I've figured out alot about how to automatically run a php function. I can't figure out where to

limit string by words??
hello all,

I was wonder if there is a function to limit a string by the number of words inste

Changing color in GD via variable?
Hey guys, I'm new here. x)

I'm very much a noob when it comes to PHP, but I'm trying to learn

The page should be expire when cilck back button
hi,
i'm new to php world.
i create user registration page.
when i submit it,data goes to my

Reg Ex
Im trying to search for the string: srv_9 (Dead ???)

I thought to use preg_match, however I d

How to Handle more than one submit button in single form?
Hi
I have one PHP file which contains one Form. In this form there are two Submit type Buttons

Generate multilayered array from string.
ok so i have a string that looks like this:
Code: [Select]blog:edit_all,delete_all|users:edit_all

Only add new information from XML to MySQL
What I am doing, is taking a xml file, and adding the values to a database. However, what I want to

Data storage spaces in varchar2
Trying to understand what's happening.
I am selecting a value from a table that is defined as c

Problem with an browser game.
Hello,i just joined that great forum and i got php prob,its kinda freaky...anyway i got browser game

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