How to store profile Images?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • neogazz
    New Member
    • Apr 2010
    • 55

    How to store profile Images?

    If a user on my website wants to add a image to his profile and store it there, what PHP (combined with MySQL) could be used to store the image and keep it displayed as his profile picture?
  • dlite922
    Recognized Expert Top Contributor
    • Dec 2007
    • 1586

    #2
    The user table neesd to have a blob column where you will store the image in raw byte and if you accept multiple mime types, maybe store the mime type in another table.

    Or the not so recommended way:

    You can store the image on a pub dir such as /users/imgages/xxx.jpg, where xxx is the unique user's ID.

    Cheers,


    Dan

    Comment

    • neogazz
      New Member
      • Apr 2010
      • 55

      #3
      I don't understand what you mean, could you please explain in more detail? Sorry I am new to PHP...

      Comment

      • dlite922
        Recognized Expert Top Contributor
        • Dec 2007
        • 1586

        #4
        You've provided little information regarding your current website, that's as detailed as I can go.

        I suggest researching key terms: MySQL Tables and Blob, Insert images into MySQL with PHP.

        This forum is for answers for specific questions, we can't help you write the entire code. It takes years to learn PHP fully, It's best to start at some point.

        w3cschools.org is a good website. There are lots of PHP books and resources online.

        Ask a specific question and I'll gladly answer it,


        Dan

        Comment

        • neogazz
          New Member
          • Apr 2010
          • 55

          #5
          No problem, thanks for the advice...have a great day :)

          Comment

          Working...