tags:

views:

24

answers:

1

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
+3  A: 

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 
Mark Baker
Thanks Mark Baker. Clear now.
bob