What is the best way to store users images using PHP and MySQL?

后端 未结 7 1429
生来不讨喜
生来不讨喜 2021-02-03 10:58

I was wondering what is the best way to store a users upload images like an avatar and so on using PHP and MySQL? Where should I begin? And is there a good article on this?

7条回答
  •  有刺的猬
    2021-02-03 11:18

    Here's an example of storing the image in binary on a MySQL database. I'm not too sure if there are any advantages or not to that. I'll leave it for someone else to comment.

    Another way you could do it is store the location of the image in a column and query it for referencing.

提交回复
热议问题