Go4Expert

Go4Expert (http://www.go4expert.com/)
-   PHP (http://www.go4expert.com/forums/php/)
-   -   picture call (http://www.go4expert.com/forums/picture-call-t2423/)

shaz 3Jan2007 08:20

picture call
 
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

shabbir 3Jan2007 10:33

Re: picture call
 
You have posted it as an Article under the Article / Source code section. I have moved it to the Queries and Discussion forum.

pradeep 3Jan2007 10:52

Re: picture call
 
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.

shaz 3Jan2007 12:51

Re: picture call
 
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

pradeep 3Jan2007 13:07

Re: picture call
 
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.


All times are GMT +5.5. The time now is 21:06.