Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
I would do so.
FILES_TABLE - table
id, filename, filepath
i.e. three "columns" each responsible for his own.
and each line has one picture.
We do not want duplicate string values in one table, so this is how:
Table 1: file_id, path
Table 2: id, file_id, title, description, ...
Accordingly, file_id is a foreign key.
PS This applies to all identical file resources.
The question is not specific.
If all the pictures are in one folder, it is enough to store the file name, and in the script do the concatenation of the path + name from the database.
If there is a need to store images from different directories in one table, it is worth asking if the database is designed correctly.
Sometimes you don't need to store the path at all, you can compose the path as id.'/avatar.jpg'.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question