01.
<?
02.
if
(
$_POST
[
"edit"
]){
03.
include
'connect.php'
;
04.
$adminid
=
$_POST
[
"txtAdminID"
];
05.
$strSQL
= "UPDATE tb_admin SET
06.
Username =
'".$_POST["txtUsername"]."'
,
07.
Password =
'".$_POST["txtPassword"]."'
,
08.
Admin_Name =
'".$_POST["txtName"]."'
09.
WHERE Admin_ID =
'$adminid'
";
10.
$objQuery
= mysql_query(
$strSQL
);
11.
if
(
$objQuery
){
12.
?>
13.
<script language=
"javascript"
>
14.
alert(
"เเก้ไขข้อมูลเรียบร้อย"
);
15.
document.location =
"addminshowindex.php?ID=<?php echo $adminid ?>"
;
16.
window.opener.location.reload();
17.
</script>
18.
<?
19.
}
else
{
20.
?>
21.
<script language=
"javascript"
>
22.
alert(
"ทำรายการผิดพลาด"
);
23.
document.location =
"addminshowindex.php"
;
24.
</script>
25.
<?
26.
}
27.
mysql_close(
$objConnect
);
28.
}
29.
?>