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?
How to store profile Images?
Collapse
X
-
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 -
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,
DanComment
Comment