Php + mysql: how to update the form content to the database in a loop mode? currently, I need to dynamically create a table on a webpage, for example, 10 rows. after entering the form, submit the code through the form as follows: PHPcodeecho & quot; & lt; formname =\& quot; php + mysql
Currently, I need to dynamically create a table on a webpage, for example, 10 rows. fill in the form and submit it through the form.
The code is as follows:
PHP code
echo "";
I want to process in process. php,
$ W = 0;
While ($ row = mysql_fetch_array ($ result ))
{
$ Filename = $ row ['filename'];
$ Time1 = $ _ POST ["$ w"];
$ W ++;
$ Time2 = $ _ POST ["$ w"];
$ W ++;
$ Time3 = $ _ POST ["$ w"];
$ W ++;
Echo "w =". $ w ."
";
$ SQL = "UPDATE fileinfo SET time1 = '". $ time1. "', time2 = '". $ time2. "', time3 = '". $ time3. "'Where filename = '". $ filename. "'";
$ Re = mysql_query ($ SQL) or die ("error:". mysql_error ());
Echo $ SQL. "--- the result is:". $ re ."
";
}
$ Time1, $ time2, and $ time3 from post are all null values. it cannot be changed to $ time1 = $ _ POST [$ w, $ time1 = $ _ POST ['$ W'] doesn't work either. I don't know if the value in $ _ POST [] can be a variable. how can I represent it .... How can this problem be solved when a table is submitted !!
------ Solution --------------------
Check the front-end page. is the name correct?
------ Solution --------------------
Try this way
PHP code
$ I = 0; while ($ row = mysql_fetch_array ($ result) {echo""; Echo"". $ Row ['filename'].""; Echo"". $ Row ['filesize'].""; // The data table contains the file name and file size, but the default playback time is 0. update the database echo by modifying the webpage"\ "Type = \" text \ ">"; Echo"\ "Type = \" text \ ">"; Echo"\ "Type = \" text \ ">"; Echo""; $ I ++ ;}
------ Solution --------------------
Print_r ($ _ POST );
------ Solution --------------------
Echo"\ "Type = \" text \ ">";
Echo"\ "Type = \" text \ ">";