Name is a variable and how to write VALUE into the database
While (!! $ _ Rows = _ fetch_array_list ($ _ result2) {?>
NormalAbnormal
This sentence
NormalAbnormal
I don't know how to get it. name is a variable. how can I transfer it to the database?
The following statements are processed:
$ V) {mysql_query ("insert into djjl (hao, bh, xm, fangfa, biaozhun, gonghao, name, time, zt) VALUES ('$ hh ', '$ V',' {$ bb [$ I]} ',' {$ cc [$ I]} ',' {$ dd [$ I]} ', '$ _ gh',' $ name', '$ _ time',' {$ zt [$ I]} ') or die (' SQL execution failed! '. Mysql_error () ;}} mysql_close (); _ alert_location (' added successfully! ', 'Ksdj. php');?>
Reply to discussion (solution)
Why is it so complicated?
Is it true to pass N name values to or to 1?
If you want to upload one, you can directly
Mysql_query ("insert into jsy set name =". $ _ POST ['name']. "where bh =". $ _ POST ['Bh ']);
If multiple data transmission is enabled, you can:
$ Str = "";
Foreach ($ _ POST as $ k => $ v) $ str. = "$ k = $ v ,";
$ SQL = "inset into jsy set". substr ($ str, 0,-2 ).";";
Mysql_query ($ SQL );
Why is it so complicated?
Is it true to pass N name values to or to 1?
If you want to upload one, you can directly
Mysql_query ("insert into jsy set name =". $ _ POST ['name']. "where bh =". $ _ POST ['Bh ']);
If multiple data transmission is enabled, you can:
$ Str = "";
Foreach ($ _ POST as $ k => $ v) $ str. = "$ k = $ v ,";
$ SQL = "inset into jsy set". substr ($ str, 0,-2 ).";";
Mysql_query ($ SQL );
I am the name of radio and I don't know how to upload it. Because there are 21 groups of radio with different names in the loop
Why is it so complicated?
Is it true to pass N name values to or to 1?
If you want to upload one, you can directly
Mysql_query ("insert into jsy set name =". $ _ POST ['name']. "where bh =". $ _ POST ['Bh ']);
If multiple data transmission is enabled, you can:
$ Str = "";
Foreach ($ _ POST as $ k => $ v) $ str. = "$ k = $ v ,";
$ SQL = "inset into jsy set". substr ($ str, 0,-2 ).";";
Mysql_query ($ SQL );
Currently, my radio uses $ _ values, which is equivalent to $ _ rows ['Bh '], because this is not repeated, so I think it's okay to name it.
The problem is:
In my $ zt = $ _ POST [''], the token should be entered, and the token written to the database below should be entered. Because there are 21 groups of radio with different names in the loop
But you should always know how to put the 21 groups of data into the database?
But you should always know how to put the 21 groups of data into the database?
I know that it is $ _ POST ['name name']. now the name is a variable and cannot be used.
How to store it in the library? You know, but I don't know
How can I help you?
Run the following command to name the file:
$ I = 0;
While (!! $ _ Rows = _ fetch_array_list ($ _ result2 )){
............
Normal
Abnormal
$ I ++;
}
After submission:
$ Zt = $ _ POST ['zt ']; can be used for traversal.
Add a hidden text box to each row of the table on the page. the value corresponds to the name of each row.
Then $ name = $ _ POST ["name "];
Run the following command to name the file:
$ I = 0;
While (!! $ _ Rows = _ fetch_array_list ($ _ result2 )){
............
Normal
Abnormal
$ I ++;
}
After submission:
$ Zt = $ _ POST ['zt ']; can be used for traversal.
Thank you for finally solving my problem. thank you very much!