java - Storing an array - MYSQL -


Given the profile table with details about the user - what is the best way to store in the database? Is allowed .

Each user has a main profile picture - then three optional additional pictures. For possible expansion ability and maintenance, I felt that three alternative images could be stored as an array of some kind (~ and if they do not choose, it can also be a faucet area).

Please advise on any best approach.

Thank you

You should create a separate table to capture the pictures, one Avoid making columns that contain CSV data, because you are used to use CSV every time. Not to mention that updating the column can be a nightmare.

  Create a table image (image_ id int, picture_fileblob, / * if you use the filename, varchar * / profile_id int / * fk to USER * /)  

Then in the profile table shows the main profile picture for the picture through the foreign key.

  Create a table of users (profile_id int, profile_picture_IDit ​​/ * main picture from fk * /)  

Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -