picture path

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Alidad
Forum Commoner
Posts: 29
Joined: Thu Mar 29, 2007 12:42 pm

picture path

Post by Alidad »

Hi,I'm rookie for php, and I'm trying to learn how to write that code. i have create upload images where i can save imges in folder called "images" and then put image file path name for sample "images-folder\image.png" along with some comments text in second column.

My question is that if i want to reterieve images and text using database how can write that statments for sample "row...."

please help me i need to learn that thanks.

AM
User avatar
califdon
Jack of Zircons
Posts: 4484
Joined: Thu Nov 09, 2006 8:30 pm
Location: California, USA

Re: picture path

Post by califdon »

guru2k9
Forum Newbie
Posts: 9
Joined: Fri Oct 30, 2009 6:24 am

Re: picture path

Post by guru2k9 »

Hi,

Please use this
<?php
$query=mysql_query("select * from table-name");
$res=mysql_fetch_array($query);
while($res)
{
?>
<img src="image-path/<?php echo $res[imagename];?>" /> </br> <?php echo $res[comments];?>
<?php
}
?>

I think this will help you.

Thanks
Post Reply