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

add to sql result
ok see rite now my sites hit counter is counted from the mysql visitor log i need to clear it aft

urldecode question
How would I format this line of code properly?

<?php echo urldecode($_GET['Title']); ?

Frustrated php Newbie
First off, I am pretty much a PHP nub. I can read and understand the language (most of the time) so

Not "Just Another" MMORPG - text based.
Hello,

I've been learning MySQL and PHP for the last 2-3 years.
Though, I've had long paus

standard ALV application toolbar, into custom report....
HI,

I have a question regarding displaying standard ALV menu path and application toolbar

error checking breaking my code
Hi there, OK first of all, big apologies for what I assume is really fundamental errors in the struc

Pls help with PHP
Pls can anyone direct me on how to create a user account for a customer. For example i want know if

Why do I get this error?
Error:

Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or

Creating a db with a query
Hello everyone.
I'm having troubles creating a db with a query.
I'm reading a book called PHP

Help a newbee save my job !
Hey guys i am dying here i am new to php and would like for someone to help me with this problem

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