01.
<html>
02.
<head>
03.
<title>ThaiCreate.Com PHP & MySQL Tutorial</title>
04.
<link rel=
"stylesheet"
type=
"text/css"
media=
"screen, projection"
href=
"demo.css"
/>
05.
<script type=
"text/javascript"
src=
"jquery-1.4.2.min.js"
></script>
06.
<script type=
"text/javascript"
src=
"jconfirmaction.jquery.js"
></script>
07.
<script type=
"text/javascript"
>
08.
09.
$(document).ready(
function
() {
10.
$(
'.ask-custom'
).jConfirmAction({question :
"Do you want to delete?"
, yesAnswer :
"Yes"
, cancelAnswer :
"Cancel"
});
11.
});
12.
13.
</script>
14.
</head>
15.
<body>
16.
<?
17.
$objConnect
= mysql_connect(
"localhost"
,
"root"
,
"root"
)
or
die
(
"Error Connect to Database"
);
18.
$objDB
= mysql_select_db(
"mydatabase"
);
19.
$strSQL
=
"SELECT * FROM customer"
;
20.
$objQuery
= mysql_query(
$strSQL
)
or
die
(
"Error Query ["
.
$strSQL
.
"]"
);
21.
?>
22.
<table width=
"600"
border=
"1"
>
23.
<tr>
24.
<th width=
"91"
> <div align=
"center"
>CustomerID </div></th>
25.
<th width=
"98"
> <div align=
"center"
>Name </div></th>
26.
<th width=
"198"
> <div align=
"center"
>Email </div></th>
27.
<th width=
"97"
> <div align=
"center"
>CountryCode </div></th>
28.
<th width=
"59"
> <div align=
"center"
>Budget </div></th>
29.
<th width=
"71"
> <div align=
"center"
>Used </div></th>
30.
<th width=
"30"
> <div align=
"center"
>
Delete
</div></th>
31.
</tr>
32.
<?
33.
while
(
$objResult
= mysql_fetch_array(
$objQuery
))
34.
{
35.
?>
36.
<tr>
37.
<td><div align=
"center"
><?php
echo
$objResult
[
"CustomerID"
];?></div></td>
38.
<td><?php
echo
$objResult
[
"Name"
];?></td>
39.
<td><?php
echo
$objResult
[
"Email"
];?></td>
40.
<td><div align=
"center"
><?php
echo
$objResult
[
"CountryCode"
];?></div></td>
41.
<td align=
"right"
><?php
echo
$objResult
[
"Budget"
];?></td>
42.
<td align=
"right"
><?php
echo
$objResult
[
"Used"
];?></td>
43.
<td align=
"center"
><a href=
"phpMySQLDeleteRecord.php?CusID=<?php echo $objResult["
CustomerID
"];?>"
class
=
"ask-custom"
>
Delete
</a></td>
44.
</tr>
45.
<?
46.
}
47.
?>
48.
</table>
49.
<?
50.
mysql_close(
$objConnect
);
51.
?>
52.
</body>
53.
</html>