D
D
Dmitry2014-09-04 15:34:59
PHP
Dmitry, 2014-09-04 15:34:59

How to organize image file naming in MySql database?

There is a list of clients, respectively, each of them has some textual information and his photo. With the growth of the list of clients, I decided to transfer everything to the MySQL database so that all new ones are automatically recorded in it.
But I ran into this problem. Text information has already been entered into the clients table, but now each client needs to match the photo that is already uploaded to the server and each file has the name and surname of the corresponding client, but in Russian. How to solve such a problem? What php functions to use to rename/name uploaded/downloaded files?
And the question is about the database itself, should I make a separate table for paths to photos or add a new field to the existing one?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
M
Melkij, 2014-09-04
@rolia17

And the question is about the database itself, should I make a separate table for paths to photos or add a new field to the existing one?

Do nothing at all with the base. What for?
Name photos by the table's primary key value.

M
Maxim Grechushnikov, 2014-09-04
@maxyc_webber

files, in my opinion, it is better not to store in the database.
and on the topic google php move_uploaded_file. google php rename files

V
vdem, 2014-09-04
@vdem

The easiest way is to name the files according to the user id in the database - then you don't need to store the paths to the photos anywhere.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question