picture call

shaz's Avatar, Join Date: Oct 2006
Light Poster
hello people...i need little help...
i am new user in php...

what i need to learn is how can i bring picture up through php...

i have a form where u can search for houses....when u click on search it retrives data from mysql and then shows the result in rows....

what i want is when a user click search it should also show the picture of the house with the information next to it...
how can i do tht....
my database is in mysql
please help
shaz
0
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
You have posted it as an Article under the Article / Source code section. I have moved it to the Queries and Discussion forum.
0
pradeep's Avatar, Join Date: Apr 2005
Team Leader
You have to store the picture somewhere on your filesystem, and store the path to the picture in your MySQL table, against each record (if u want). While outputting the result, just print an IMG tag with the path-to image.
0
shaz's Avatar, Join Date: Oct 2006
Light Poster
Quote:
Originally Posted by pradeep
You have to store the picture somewhere on your filesystem, and store the path to the picture in your MySQL table, against each record (if u want). While outputting the result, just print an IMG tag with the path-to image.
hi pardeep
good to c u after long time...
thanks for advice but to be to be honest i didnt get it....can u give me rough idea of storing the picture in filesystem and how i am suppose to store the path in mwsql...

thanks alot
pardeep
0
pradeep's Avatar, Join Date: Apr 2005
Team Leader
You need a path field in your table. You can save the file in say '/var/www/html/images/123.jpg' and the store the relative path in the path field like this '/images/123.jpg'.
And when you print the resultset, just print like this..

Code: PHP
<?
$row = mysql_fetch_array($result);
print "<img src='{$row['path']}'>";
?>

I hope you got the flow.