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

need help in php variable
i have a php variable on one page
Code: [Select]$lastId = mysql_insert_id($db);
echo $lastId;<

mysql VARCHAR acting like INT
Hi, All.

I have a table that contains a varchar(10) column named weird_field. In this column

Displaying data from database into a 2 dimensional table
Good day!

I'm a beginner in PHP and I'm not expecting a full coding for this qestion. I'm jus

help with Get_
ok some how this is not working i am not sure what i am doing wrong here but what this does is when

UDS 4.0 Datatype issue
UDS 4.0.322 -- connecting to NI Labview 9.0

When using connection method: Cache with live

Form always sends to error page...
Hello,
Any help will be greatly appreciated. I am having trouble getting multiple fields to be re

md5 is it unique
I know this is most likely one of many simple questions that can be found semi easily. But I'm press

Disabling SAP menu
How do I disable SAP menu for all the users and just restrict them to User Menu in SAP ECC 6.0?

Not Inserting into DB
I can't get my Add new Division form to submit to the database. Anyone see my issue?

Code: &a

Weekly Calendar
Hi, I am looking at creating a weekly calendar. The calendar will read from Monday - Sunday. Does an

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