I created a php system that generates 150 "Serial Number" for each product. Now I want to store these serial numbers in a database. There are some ways that I found to do this:
- Create a table name
products_serialNumber
and store each serialnumber to 1 record and relate it to products usingproduct_id
key.
If I do this, I will have lots of data that may no body use that. But fetching data in this way is more easier and faster.
- Create a table name
product_serialNumbers
and store array of serialnumbers for each products and relate is using "product_id" key again.
If I do like this way, I will have a serial numbers record for each products, but I should use more foreach
and for loop
functions to extract array of data and variables to use where that I need, and use lots of memory. I'm limited to 64m using memory.