I would like to update looping data when user submit.
Here is the table, called "T1":
+-------+------------+----------------+-----------------+-----------+
| id | areacode | type | price | time |
+-------+------------+----------------+-----------------+-----------+
| 1 | 1 | 1 | 100000 | 12345678 |
| 2 | 1 | 1 | 100000 | 12345678 |
| 3 | 1 | 1 | 100000 | 12345678 |
| 4 | 1 | 1 | 100000 | 44444444 |
+-------------------------------------------------------------------+
The id is Auto_Increase in T1.
I loop my data like this:
$query = DB::query("SELECT * FROM ".DB::table('land')." WHERE areacode = '$areaid'");
while($row = DB::fetch($query)) {
$i = $i+1;
$areacode = $row['areacode '];
$time = date("Y-m-d H:i",($row['time']));
$type = $row['type'];
$price = $row['price'];
$rowid = $row['id'];
if ($type == 1){
$valuetype = '<label><input name="radio['.$i.']" type="radio" id="radio" value="1" checked="checked" />
normaltype</label>
<label><input type="radio" name="radio['.$i.']" id="radio" value="2" />hightype</label>';
}else{
$valuetype = '<label><input type="radio" name="radio['.$i.']" id="radio" value="1" />normaltype</label>
<label><input name="radio['.$i.']" type="radio" id="radio" value="2" checked="checked" />hightype</label>';
}
$sqlsearch .= '<tr><td>'.$rowid.'</td>
<td>'.$areaname.'</td>
<td>'.$valuetype.'</td>
<td>'.$price.'</td>
<td>'.$rowbuytimes.'</td>
</tr>';
}
include template('admincp_area');
if($_GET['mod'] =='updatearealand'){
//how to update the mysql when user submit the loop data
}
My template coding is:
<form method="post" autocomplete="off" name="paynameform" action="plugin.php?id=admincp&do=area&areaid=1&mod=updatearealand" enctype="multipart/form-data" ><table width="100%" border="1" cellspacing="0" cellpadding="5">$sqlsearch</table><input name="" type="button" /></form>
I can looping the above data, but I don't know how to update the looping data when user submit the form. Part of data user can edit is the radio.
Please help me to looking on this matter, thank you.