Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Sep 2012
    Posts
    87
    Thanks
    18
    Thanked 0 Times in 0 Posts

    Displaying a photo from a link in a database

    I have created a database table with a column containing links of photos. What PHP/HTML/SQL code should I use to display the photos on a webpage?

  • #2
    Regular Coder
    Join Date
    Mar 2012
    Posts
    168
    Thanks
    5
    Thanked 11 Times in 11 Posts
    Assuming you have already called the information from the database and are currently working with a single row:

    Code:
    echo '<img src = "' . dbResult['photo'] . '" alt = "picture of something" />'
    or

    Code:
    echo '<img src = "images/' . dbResult['photo'] . '" alt = "picture of something" />'

  • #3
    New Coder
    Join Date
    Sep 2012
    Posts
    87
    Thanks
    18
    Thanked 0 Times in 0 Posts
    Thanks KULP. It worked!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •