while (!!$_rows = _fetch_array_list($_result2)){?><tr><td><?php echo $_rows['bh'];?><input name="bh[]" type="hidden" value="<?php echo $_rows['bh'];?>"/></td><?php $_values=$_rows['bh'];?><td><?php echo $_rows['xm']?><input name="xm[]" type="hidden" value="<?php echo $_rows['xm'];?>"/></td><td><?php echo $_rows['fangfa']?><input name="fangfa[]" type="hidden" value="<?php echo $_rows['fangfa'];?>"/></td><td><?php echo $_rows['biaozhun']?><input name="biaozhun[]" type="hidden" value="<?php echo $_rows['biaozhun'];?>"/></td><td><input type="radio" name="<?php echo $_values?>" value="正常" style="zoom:150%;" />正常<input type="radio" name="<?php echo $_values?>" value="不正常"/>不正常</td></tr>
<td><input type="radio" name="<?php echo $_values?>" value="正常" style="zoom:150%;" />正常<input type="radio" name="<?php echo $_values?>" value="不正常"/>不正常</td>
<?php $hh=$_POST['hao1'];$aa=$_POST['bh'];$bb=$_POST['xm'];$cc=$_POST['fangfa'];$dd=$_POST['biaozhun'];$_gh=$_COOKIE["name"]; $_time=$_POST['time'];$zt=$_POST[''];$name=implode(_fetch_array_list(mysql_query("SELECT name FROM jsy WHERE gonghao = $_gh")));if (is_array($aa)){foreach ($aa as $i=>$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执行失败!'.mysql_error());}}mysql_close();_alert_location('添加成功!','ksdj.php');?>
为何要搞得这么复杂呢?
到底是传N个name的value进入还是传1个?
如果是传1个可以直接
mysql_query("insert into jsy set name = " . $_POST['name'] . " where bh = " . $_POST['bh']);
如果多传可以:
$str = "";
foreach($_POST as $k => $v) $str .= "$k = $v, ";
$sql = "inset into jsy set " . substr($str, 0, -2) . ";";
mysql_query($sql);
为何要搞得这么复杂呢?
到底是传N个name的value进入还是传1个?
如果是传1个可以直接
mysql_query("insert into jsy set name = " . $_POST['name'] . " where bh = " . $_POST['bh']);
如果多传可以:
$str = "";
foreach($_POST as $k => $v) $str .= "$k = $v, ";
$sql = "inset into jsy set " . substr($str, 0, -2) . ";";
mysql_query($sql);
为何要搞得这么复杂呢?
到底是传N个name的value进入还是传1个?
如果是传1个可以直接
mysql_query("insert into jsy set name = " . $_POST['name'] . " where bh = " . $_POST['bh']);
如果多传可以:
$str = "";
foreach($_POST as $k => $v) $str .= "$k = $v, ";
$sql = "inset into jsy set " . substr($str, 0, -2) . ";";
mysql_query($sql);
但你总该知道这21组数据该怎么放进数据库里的吧?
但你总该知道这21组数据该怎么放进数据库里的吧?
怎么放到库里?你知道,但我不知道
你不告诉我,我怎么帮你?
这样命名试下:
$i=0;
while (!!$_rows = _fetch_array_list($_result2)){
............
在页面表格每一行增加一个隐藏文本框,值对应每一行的名字。
然后$name=$_POST["name"];就可以了
这样命名试下:
$i=0;
while (!!$_rows = _fetch_array_list($_result2)){
............