01.
<?
02.
03.
require_once
"connectdb.php"
;
04.
require_once
"tdate.php"
;
05.
06.
$strSQL
=
"UPDATE member "
;
07.
$strSQL
.=
" SET name_th = '"
.
$_POST
[
"name_th"
]."'
08.
last_name_th =
'".$_POST["last_name_th"]."'
09.
WHERE id =
'".$_GET["id"]."'
";
10.
$objQuery
= mysql_query(
$strSQL
);
11.
12.
13.
if
(
$_FILES
[
"member_photo"
][
"name"
] !=
""
)
14.
{
15.
if
(
copy
(
$_FILES
[
"member_photo"
][
"tmp_name"
],
"IMG/"
.
$_FILES
[
"member_photo"
][
"name"
]))
16.
{
17.
@unlink(
"IMG/"
.
$_POST
[
"member_photo"
]);
18.
19.
$strSQL
=
"UPDATE member"
;
20.
$strSQL
.=
" SET member_photo = '"
.
$_FILES
[
"member_photo "
][
"name"
].
"' WHERE id = '"
.
$_GET
[
"id"
].
"' "
;
21.
$objQuery
= mysql_query(
$strSQL
);
22.
23.
echo
"<script>alert('แก้ไขผู้ใช้ ID $_POST[id] เรียบร้อยแล้ว');location='home.php';</script>"
;
24.
25.
}
26.
}
27.
?>