1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

picture call

Discussion in 'PHP' started by shaz, Jan 3, 2007.

  1. shaz

    shaz New Member

    Joined:
    Oct 21, 2006
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    0
    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
     
  2. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,283
    Likes Received:
    364
    Trophy Points:
    83
  3. pradeep

    pradeep Team Leader

    Joined:
    Apr 4, 2005
    Messages:
    1,646
    Likes Received:
    86
    Trophy Points:
    0
    Occupation:
    Programmer
    Location:
    Kolkata, India
    Home Page:
    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.
     
  4. shaz

    shaz New Member

    Joined:
    Oct 21, 2006
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    0
    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
     
  5. pradeep

    pradeep Team Leader

    Joined:
    Apr 4, 2005
    Messages:
    1,646
    Likes Received:
    86
    Trophy Points:
    0
    Occupation:
    Programmer
    Location:
    Kolkata, India
    Home Page:
    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..

    PHP:
    <?
    $row mysql_fetch_array($result);
    print 
    "<img src='{$row['path']}'>";
    ?>
    I hope you got the flow.
     

Share This Page