Call multiple resources at a time, and then perform different processing on the same website one by one, the last "same time" parameter update or insert. The update and insert data records received for each item are not the same! ======================================
Which of the following statements about loop + array?
1. obtain the information from the Resource:
When db_query is used for looping, the information that the related bit needs to be updated is routed to the array.
Based on your needs, these resources can be presented using text, checkbox, or hidden. Of course, checkbox is the most common type.
For example, a large number of checkboxes are used in the processing of parts.
2. The modified information is stored back as an operation.
It must be in count (array) + loop + db_update:
The result of the root distinct count is rotated, and db_update is put in, so that the loop can complete the update operation of all resources.
Example:
========================================================== ==========
#### 1. Update. php: retrieve the information using loop + array to update ........
<Form action = "Activate. php">
# Call data here
$ Query = "select * from $ userstable where ...................
# Import loop to retrieve data one by one
$ I = 0;
While ($ I <$ num ):
...............
$ Id = mysql_result ($ result, $ I, "ID ");
..................
............................
# Use the struct type to retrieve the required updated struct, and construct it into array ..........
Echo "<TD align ...................
Echo "<TD align = middle> <input type = text size = 3 name = \" cname [] \ "value = \" $ name \ "> </TD> </ tr> ";
Echo "<input type = hidden name = \" CID [] \ "value = \" $ ID \ "> ";
$ I ++;
Endwhile;
========================================================== ====================
#### 2. activate. PHP: After the data is updated, the loop + array is used to save the data ...................
.......
For ($ I = 0; $ I <count ($ cname); $ I ++ ){
$ Name = $ cname [$ I];
$ Id = $ CID [$ I];
$ Query = "Update $ userstable set name = '$ name' where id =' $ id '";
.............