
Originally Posted by
Razzinator
transpnt table
transfer._id // 1 colomn
paint._id //28 columns
admin can input an array while adding a transfer.
am I on the right track now?
A bit I think 
So let's take the transfer and paint tables:
Transfers
_id
name
number
price
discription
image1
image2
Paints
_id
name
number
price
discription
image1
image2
1 transfer can have up to 28 paints, right? And surely a paint can be used in more than 1 transfer.
So you need a transpnt table (as you said), which will have only 2 columns:
transfer_id
paint_id
In this table you'll save a row for each transfer-paint combination that is inserted by the admin.
Attention: the way you store data in your database, and the way you display it to the user, or the way you let the user insert it, isn't always 1-on-1.
In this case, if you want to limit the max number of paints for 1 transfer to 28, you'll have to impose that limit in your PHP code (or whatever language you use). And if you want to have the user insert the paints like this:
Code:
value 1, value 2, value 3, ...
that's ok too. Again, in your PHP code you'll have to sanitize and validate any user input anyway, and you can also turn a comma separated value string like that in single values that you'll insert in the table.
Are you following so far?
Bookmarks