//แก้ไขข้อมูล
$sname="";
$id="";
$lname="";
$gender="";
$data="";
$age="";
$address="";
$phone="";
$sqledit="select * from employee where id=" . $_GET['id'];
$resultedit=mysqli_query($con,$sqledit);
while($row=mysqli_fetch_assoc($resultedit)){
$sname = $row['sname'];
$id = $row['id'];
$lname=$row['lname'];
$gender=$row['gender'];
$data=$row['data'];
$age = $row['age'];
$address=$row['address'];
$phone = $row['phone'];
}
............................................................................................................................
<?php
$sql="select * from employee";
$result=mysqli_query($con,$sql);
while($row=mysqli_fetch_assoc($result)){
//แสดงผล
echo '<tr>
<td>'.$row['id'].'</td>
<td>'.$row['sname'].'</td>
<td>'.$row['lname'].'</td>
<td>'.$row['gender'].'</td>
<td>'.$row['data'].'</td>
<td>'.$row['age'].'</td>
<td>'.$row['address'].'</td>
<td>'.$row['phone'].'</td>
<td>
<a href="edit_employee.php?id='.$row['id'].'" class="btn btn-success"><i class="glyphicon glyphicon-pencil"></i></a>
<a href="#" onclick="dialog('.$row['id'].');" class="btn btn-danger"><i class="glyphicon glyphicon-trash"></i></a>
</td>
</tr>';
}
?>
สอบถามโค๊ดหน่อยครับ ทำไมแก้ไขข้อมูลไม่ได้ php
$sname="";
$id="";
$lname="";
$gender="";
$data="";
$age="";
$address="";
$phone="";
$sqledit="select * from employee where id=" . $_GET['id'];
$resultedit=mysqli_query($con,$sqledit);
while($row=mysqli_fetch_assoc($resultedit)){
$sname = $row['sname'];
$id = $row['id'];
$lname=$row['lname'];
$gender=$row['gender'];
$data=$row['data'];
$age = $row['age'];
$address=$row['address'];
$phone = $row['phone'];
}
............................................................................................................................
<?php
$sql="select * from employee";
$result=mysqli_query($con,$sql);
while($row=mysqli_fetch_assoc($result)){
//แสดงผล
echo '<tr>
<td>'.$row['id'].'</td>
<td>'.$row['sname'].'</td>
<td>'.$row['lname'].'</td>
<td>'.$row['gender'].'</td>
<td>'.$row['data'].'</td>
<td>'.$row['age'].'</td>
<td>'.$row['address'].'</td>
<td>'.$row['phone'].'</td>
<td>
<a href="edit_employee.php?id='.$row['id'].'" class="btn btn-success"><i class="glyphicon glyphicon-pencil"></i></a>
<a href="#" onclick="dialog('.$row['id'].');" class="btn btn-danger"><i class="glyphicon glyphicon-trash"></i></a>
</td>
</tr>';
}
?>