Page 1 of 1

picture path

Posted: Tue Nov 17, 2009 5:15 pm
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

Re: picture path

Posted: Tue Nov 17, 2009 5:35 pm
by califdon

Re: picture path

Posted: Tue Nov 17, 2009 10:39 pm
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