Php+mysql How to update the form contents to a database in a circular fashion
I currently need to dynamically create a form on a Web page, such as 10 lines, fill out the form and submit it via the form
The code is as follows:
PHP Code
I want to deal with it in the process.php,
$w = 0;
while ($row = Mysql_fetch_array ($result))
{
$filename = $row [' filename '];
$time 1 = $_post["$w"];
$w + +;
$time 2 = $_post["$w"];
$w + +;
$time 3 = $_post["$w"];
$w + +;
echo "w= at this time." $w. "
";
$sql = "UPDATE fileinfo SET time1=". $time 1. "', time2= '". $time 2. "', time3= '". $time 3. "' WHERE filename= ' ". $filename." ' ";
$re = mysql_query ($sql) or Die ("error:". Mysql_error ());
echo $sql. " ---result is: ". $re."
";
}
POST over the $time1, $time 2, $time 3 are empty values, changed to $time1 = $_post[$w] Also not, $time 1 = $_post[' $w '] also not, do not know $_post[] inside the value can be a variable, how to say ah .... How to deal with the situation of submitting a form!!
------Solution--------------------
Would you look at the foreground page and name it?
------Solution--------------------
Give it a try.
PHP code
$i = 0; while ($row = Mysql_fetch_array ($result)) {echo ""; echo "". $row [' filename ']. ""; echo "". $row [' FileSize ']. "";//The data table already has the file name and file size, but the playback time is default to 0, update the database through Web page modification echo "\ "Type=\" Text\ ">"; echo "\ "type=\" text\ ">"; echo "\ "type=\" text\ ">"; echo ""; $i + +;
------Solution--------------------
You first Print_r ($_post) and look at
------solution--------------------
Echo \" type=\ "text\" > ";
echo "\ "type=\" text\ ">";