I am creating a website to purchase books online using PHP and MySQL, and my problem is:
How to store images of books in a database knowing that the photo of each book should appear in the consultation of books offered on the site. I know that to store images in a database slows down query execution... What is the method better than the latter? Thank you in advance.
I think the easiest way is to store the picture link in the database and not the image itself.
- Make a column for example img_src and paste the link to your photo.
- Example: C: \ www \ site \ images \ myphoto.jpeg
- When generating page views, make:
- You will have all the information, simply paste it in a table.
Solved by Skeletyon
This document, titled « Insert an Image in a MySQL database », is available under the Creative Commons
license. Any copy, reuse, or modification of the content should be sufficiently credited to CCM