How can I use the for loop to increase variable names? Urgent! Urgent! Urgent! My SQL statements are: $ insertSQL & quot; values (id, qj_date, Customer_num, Customer_name, kanyang, print, xiupian, tiaose, tx_tiaose, design, check_m, other) how does one use the for loop to increase variable names? Urgent! Urgent! Urgent!
My SQL statement is: $ insertSQL = "INSERT INTO yx_tab2_m (id, qj_date, Customer_num, Customer_name, kanyang, print, xiupian, tiaose, tx_tiaose, design, check_m, other) VALUES ('$ table_id', '$ _ POST [qj_date1]', '$ _ POST [mermer_num1]', '$ _ POST [Customer_name1]', '$ _ POST [kanyang1]', '$ _ POST [print1]', '$ _ POST [xiupian1]', '$ _ POST [tiaose1]', '$ _ POST [tx_tiaose1]', '$ _ POST [design1]', '$ _ POST [check1]', '$ _ POST [other1]') ";
$ _ POST [qj_date1], $ _ POST [Customer_num1], $ _ POST [Customer_name1] ...... These values are obtained through the form, but there are many tables to submit the form, and they are all regular. I want to use the for loop to put $ _ POST [qj_date1], $ _ POST [Customer_num1], $ _ POST [Customer_name1] ...... Change to $ _ POST [qj_date2], $ _ POST [Customer_num2], $ _ POST [Customer_name2] ...... This is equivalent to increasing the name of the form element from the form's variable names by 1. how can I get SQL statements? please help me. if you cannot understand it, contact QQ: 1677546723, help me. this problem has plagued me for several days ......
------ Solution --------------------
For ($ I = 0; I I <100; $ I ++ ){
Echo $ _ POST ['qj _ date'. $ I];
}