To help you, I use Phpexcel, demand this: there are two kinds of Excel table, the first one is an order no matter how many goods are accounted for a row, the second is an order has a few goods to occupy a few lines, such two kinds of Excel import, how to handle the storage in the database? To store the imported information in three tables.
Reply to discussion (solution)
Table structure design is very important, in fact, your 2 sheet is the order form and the order schedule
The first is an order, no matter how many items are in a row (order form, record basic information, such as customer name, address, telephone, freight, etc.)
The second is an order with a few items to occupy a few lines (order schedule, record the specific product list)
You can also create these 2 tables in the database, and then get the data through Phpexcel, and then insert them into the table by mysql_query inserts.
What is the meaning of the main deposit to 3 tables? As you can tell, an order form is not an order list? When you process the Phpexcel data, the basic information such as the order ID is stored in the order form, and then the product information in the order is stored in the order list according to the corresponding order ID.
Well, both of them are right, I am this: when the import, Excel table has a row is a complete order information, some lines a complete order information, after the import into the program, inserted into the database how to judge the end of a complete order information? What do you mean if an order has three rows (three products) to insert into the database?
The contents of the cell you're not going to read it?
Does each quantity precede with a descriptive text?
It's not just numbers, is it? Even then, you can read the data according to the agreed position.
So, let me take a picture to illustrate the problem I'm having.
2nd, 3 line is no problem, see, 4, 5, 6 line is an order information, I put Excel into the program inside, put in an array, printed out is not right. 2nd, 3 lines, one line is an order information, 4, 5, 6 line is an order information. You see, this is the problem I encountered, my qq:624843426, see after help me to analyze the next chant.
130721w2r7yx should read A5, A6 no value from A4
Since the corresponding B4, B5, B6 have values, the value of A4 should be brought into A5, A6
When does it end? It ends when you encounter annn and bnnn that have no value or both have values.