0

Below is my current structure for MySQL database

id | item_name  | item_files 
------------------------------------------
1  | Item A     | file1.zip,file2.zip,file3.zip
2  | Item B     | file3.zip 

Example I create simple form to fill up Item Name and Multiple upload files then store it to db.

Question :-

  1. How to design the db structure for accept the multiple files?
  2. There have a way which I don't want to use explode, implode to get the file1.zip file2.zip file3.zip

1 Answer 1

3

Normalize your data tables

items table

id  | item_name
--------------
1  | Item A
2  | Item B

item_files table

id  | item_id | item_files  
----------------------------------- 
1  | 1      | file1.zip
2  | 1      | file2.zip
3  | 1      | file3.zip 
4  | 2      | file3.zip 
Sign up to request clarification or add additional context in comments.

1 Comment

Thanks Mark Baker. Clear now.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.