通过表

时间:2017-03-28 02:53:29

标签: php html5 mysqli

您好我无法使用mysqli查询更新在表中提取的多条记录,这是我的代码:

$count = 1;
if (mysqli_num_rows($data) > 0){
    while($roww = mysqli_fetch_assoc($data)) {
        echo '<tr>
            <td>' . $count. '</td>
            <td>' . $roww["enrolment"]. '</td>
            <td>' . $roww["student_name"]. '</td>
            <td>' . $roww["father_name"]. '</td>
            <td>' . $roww["email"]. '</td>
            <td> <input type="number" class ="form-control" min="2000" max="2099" value = '. $roww["rjit_year"] .'  > </td>
            <td> <input type="number" class ="form-control" min="2000" max="2099" value = '.$roww["rjit_end"].'  > </td>
            <td> <input type="checkbox" class="js-switch" value = "0" '; if($roww["active"] == 0) echo "checked" ; echo '/></td>
            <td> <input type="checkbox" class="js-switch" value = "1" '; if($roww["active"] == 1) echo "checked" ; echo ' /></td>
        </tr>';
        $count++;
    }
}else {
    echo "0 results";
}
mysqli_close($db);

这里<td>' . $roww["enrolment"]. '</td>是evry用户的唯一值,他能够编辑最后四个,现在根本不知道如何做到这一点。 这是html的视图 enter image description here

1 个答案:

答案 0 :(得分:0)

"UPDATE table_name SET column_name1=' value[$array]', column_name2=' value[$array]' WHERE column_name=' value[$array]' ";