How to use the for loop to increase variable names?

Source: Internet
Author: User
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];
}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.