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

highlighting search terms
well, I started this in the regular PHP section, but it no longer fits there. Suffice it to say, I'm

listing help
Hi,

at first, great new design!!! I like it,

i got a problem,

I want to list so

Php WordPress help
I am writing the following code for making a plugin

<?php
header("Content-Type

Creating a unique 'control panel' for each user
Hi there,

I'm thinking of designing a site that will allow users to sign up and have their ow

Join Query Help
Hi all,

I am having problems with the below code, which we shall call 'my first join query'!

Mysql query, two times?
Hello to all,

I'm new to php coding and i like it alot. I need help with some noob stuff.

Pagination
Hi All,

I think I'm finally getting somewhere with pagination!

I can now submit a quer

array_combine() trouble w/csv file
I have a problem with a piece of code I wrote to import some records from a csv file into mysql. I h

Syntax Help
Code:


im having trouble with that code snipped
Parse error: syntax error, unexpec

iterating through an array and escape each value independently.
I have a set up where the variable being escaped is an array and it needs to be iterated and escaped

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