php - How to handle a set of array inputs and insert multiple rows -


i have 2 tables namely invoice , purchase_list.

invoice :

invoice_number, invoice_date, customer_id, invoice_purchase_value, invoice_tax, invoice_bill_amount

purchase_list

purchase_id, invoice_number, customer_id, purchase_rate, purchase_quantity, purchase_value

for particular bill, insert bill's main details in invoice table , corresponding products purchase list in purchase_list table.

usually many products been purchased in 1 invoice.

here comes problem. 1 insert statement enough invoice table. but, purchase_list, multiple insert statements required. (for ex, if 6 items purchased in 1 invoice, 6 insert statements should executed.)

i in thought of sending purchased values in array format php. if so, how can extract values arrays , insert purchase_list table or other ways implement same..?

i newbie mysql. please brief in detail.

thanks in advance.

look pdo prepared statements.


Comments

Popular posts from this blog

php - regexp cyrillic filename not matches -

c# - OpenXML hanging while writing elements -

sql - Select Query has unexpected multiple records (MS Access) -