01.
<?
02.
$con
= mysql_connect(
"localhost"
,
"root"
,
"1234"
);
03.
if
(!
$con
)
04.
{
05.
die
(
'Could not connect: '
. mysql_error());
06.
}
07.
08.
mysql_select_db(
"ebandit"
,
$con
);
09.
mysql_query(
"SET NAMES UTF8"
);
10.
mysql_query(
"SET character_set_results=utf8"
);
11.
$sql
=
"update customer set custname='$a2',sex='$a3',address='$a4',tel='$a5' where custno='$a1'"
;
12.
13.
if
(!mysql_query(
$sql
,
$con
))
14.
{
echo
"error"
; }
15.
else
16.
{
echo
"update data = <font color=red>'$a1'</font> is successful."
; }
17.
18.
mysql_close(
$con
)
19.
?>