不知道你想表达什么意思$modifysql = "update table set username='$username' where id='$id' ";

解决方案 »

  1.   

    set `字段1`='值1',`字段2`='值2'我理解成这个意思……
      

  2.   

    谢谢楼上的朋友表单里的name="<? echo $row_list['id']; ?>"不是特定的id、username
      

  3.   

    $modifysql = "update table set `$username`='$username' where id='$id' ";要是字段很多的话可以组成字符串啊
    $modifysql = "update table set ";
    while(...)  //   把字段变量和字段值传近来 或者写成数值也行   反正大概就是这个意思
    {
      $modifysql = $modifysql. "`$username`='$username'" ;
    }
    $modifysql = $modifysql. " where id='$id' ";或者直接写成UPDATE类  
      

  4.   

    请大家注意,input的值是name="<? echo $row_list['id']; ?>"表单提交了多条数值,同时update多条数值
      

  5.   

    逻辑:处理一个词表,数据库表有个状态字段,int,标志每个词的状态,是被采用、保留、舍弃,未处理,数字是1、2、3、0来代表。这个页面就是为每个词选它的状态,然后update到数据库里。php:
    <?
    if($action==modify){
    $modifysql = "update top500 set choose='这里不知道怎么写,或是加循环处理' where id='$id' ";
    mysql_query($modifysql);
    }
    ?>表单:<form name="choose" method="post" action="index.php?action=modify">
    <table>
      <?php do { ?>
      <input name="id" type="hidden" value="<? echo $row_list['id']; ?>">
      <tr> 
        <td><?php echo $row_list['id']; ?></td>
        <td><input type="radio" name="<? echo $row_list['id']; ?>" value="1"></td>
        <td><input type="radio" name="<? echo $row_list['id']; ?>" value="2"></td>
        <td><input type="radio" name="<? echo $row_list['id']; ?>" value="3"></td>
      </tr>
      <?php } while ($row_list = mysql_fetch_assoc($list)); ?>
    </table>
    <input type="submit" name="submit" value="提交">
    </form>
      

  6.   

    如果你要更新的字段的值的名称是$row_list['id'];的话,
    因为你的名字是动态的可以采用下面的这种方式do { 
    update table set 字段='".$row_list['id']."'where id='$id' ";} while ($row_list = mysql_fetch_assoc($list)); ?>
      

  7.   

    将选择框的名称和值在提交前用js写入一个hidden框内,数据之间可以用“|”分隔,在处理页面将这段字符串按照分割为到数组里,然后根据数组的奇数项(字段名)和偶数项(对应的值)的值来写入数据库
      

  8.   

    提交成一个数组,一个一个UPDATE吧