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 6 of 6
  1. #1
    New Coder
    Join Date
    Dec 2011
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation php image profile help

    okay, so I have created this website where someone will upload a picture, provide their name and email, and give the photograph a description. And everything is working just fine.

    However, I would like after submitting their image for there to be a link provided to the uploader of their image and the description they gave of that image.

    How would I do this?

    Thank you very much!!!!!

  • #2
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,549
    Thanks
    8
    Thanked 1,095 Times in 1,086 Posts
    Refer to this thread:
    http://www.codingforums.com/showthread.php?t=250482

    Let me know if you are putting images into the database or into a directory.

    It appears you are dealing with the same kind of issue as that other thread.

  • #3
    New Coder
    Join Date
    Dec 2011
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by mlseim View Post
    Refer to this thread:
    http://www.codingforums.com/showthread.php?t=250482

    Let me know if you are putting images into the database or into a directory.

    It appears you are dealing with the same kind of issue as that other thread.
    Hi, thank you for replying.
    I'm using a directory not a database. I looked at the other thread you provided, but there doesn't appear to be a solution.
    The image upload is working, and it places the file name into a column into the database called 'filename'. Images are located in the directory 'compare/images/'.
    If there's anymore information I can provide, please let me know.


    Edit: I just noticed your questions in the other thread, I'll answer them.

    1) Stored in a directory
    2) There are no users, but there is a name and email, and description the uploader must provide when uploading the image. The upload script I have inserts this information into the database into their respective fields. I would like the name, and the description to appear underneath the image that is being linked to
    3) For now, it is okay that the images are in their original filenames
    4) The person does not need to log in
    5) The person cannot upload multiple images
    6) I am using a mysql database, yes
    7) I do not need to generate a thumbnail version of each image


    Thanks again!
    Last edited by coder11001; 02-03-2012 at 11:58 AM.

  • #4
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,549
    Thanks
    8
    Thanked 1,095 Times in 1,086 Posts
    So in your case, you'll need a new column created in your database table ...
    the new column that you create will contain the filename of the image.

    You can all the new column -- image VARCHAR(20)

    When a user id is queried, you'll be able to see the filename of the image they uploaded.

    Then it's easy to just display the user's text under the image and do whatever you want.

    The way you're doing it (in my opinion) is the best way.
    Storing images (the binary image) in a table makes things more difficult.

  • #5
    New Coder
    Join Date
    Dec 2011
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by mlseim View Post
    So in your case, you'll need a new column created in your database table ...
    the new column that you create will contain the filename of the image.

    You can all the new column -- image VARCHAR(20)

    When a user id is queried, you'll be able to see the filename of the image they uploaded.

    Then it's easy to just display the user's text under the image and do whatever you want.

    The way you're doing it (in my opinion) is the best way.
    Storing images (the binary image) in a table makes things more difficult.
    How would I conduct a query, to echo a row, given just one field, such as the the user id or the username?

    thanks.

  • #6
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,549
    Thanks
    8
    Thanked 1,095 Times in 1,086 Posts
    SELECT * FROM tablename WHERE userid='123'

    I don't know your tablenames, nor do I know your column names.

    I suggest you use Google to find a free PHP/MySQL tutorial,
    because there's more to it than just a query string.


  •  

    Tags for this Thread

    Posting Permissions

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