S
S
survivor20052020-12-07 12:07:42
PHP
survivor2005, 2020-12-07 12:07:42

How to link a photo to a product card in the database?

Good afternoon, sorry for the stupid question, but it's better to ask than to sculpt a gag.
The question is as follows:
Let's say there is a product card, text data such as a header, product properties are entered in the database. But it is not clear what to do with the photo that is in the product card, how to properly store data about this photo. Either the name of the folder in which photos about the product are stored (since there can be several photos for each product), or the name of each photo separated by commas. Share your experience, maybe you don’t need to store any information about the photo in the database at all.
Thank you.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
FanatPHP, 2020-12-07
@survivor2005

In the simplest version, you don’t need to store any information at all - the product ID is stupidly taken as the folder name, and the pictures are uploaded to this folder.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question