mysql_connect("localhost","root",""); mysql_select_db("db_amclms"); $query=mysql_query("SELECT * FROM 'tb_student'");
您可以将列表解析为数组中的PHP函数。
前端HTML
使用隐藏/只读输入设置表列val: id[] = array
...
...
后端
以任何所需的方法以某种形式解析为PHP,然后遍历数组。
$newarray= array(); $loop=0; $countedlist = count($_REQUEST['student_id']); while( $loop <= $countedlist ){ /* get other field in the arrangement of the array. they should be queued correctly at this stage,so dont worry */ //Assign to new array list.... $_REQUEST[$loop]['student_fname']; $loop++; } // lastly,commit a query for the new assigned array to insert into DB. Make sure to run it once,never loop the query through any loop function. Threfore you need to insert using a serial of array in a query is the best option.