01.
<html>
02.
<head>
03.
<title>ThaiCreate.Com PHP & SQL Server Tutorial</title>
04.
</head>
05.
<body>
06.
<?php
07.
include
(
"phpSQLServerConnectDatabase.php"
);
08.
$strSQL
=
"SELECT * FROM customer"
;
09.
$objQuery
= mssql_query(
$strSQL
)
or
die
(
"Error Query ["
.
$strSQL
.
"]"
);
10.
?>
11.
<table width=
"600"
border=
"1"
>
12.
<tr>
13.
<th width=
"91"
> <div align=
"center"
>CustomerID </div></th>
14.
<th width=
"98"
> <div align=
"center"
>Name </div></th>
15.
<th width=
"198"
> <div align=
"center"
>Email </div></th>
16.
<th width=
"97"
> <div align=
"center"
>CountryCode </div></th>
17.
<th width=
"59"
> <div align=
"center"
>Budget </div></th>
18.
<th width=
"71"
> <div align=
"center"
>Used </div></th>
19.
</tr>
20.
<?php
21.
while
(
$objResult
= mssql_fetch_array(
$objQuery
))
22.
{
23.
?>
24.
<tr>
25.
<td><div align=
"center"
><?php
echo
$objResult
[
"CustomerID"
];?></div></td>
26.
<td><?php
echo
$objResult
[
"Name"
];?></td>
27.
<td><?php
echo
$objResult
[
"Email"
];?></td>
28.
<td><div align=
"center"
><?php
echo
$objResult
[
"CountryCode"
];?></div></td>
29.
<td align=
"right"
><?php
echo
$objResult
[
"Budget"
];?></td>
30.
<td align=
"right"
><?php
echo
$objResult
[
"Used"
];?></td>
31.
</tr>
32.
<?php
33.
}
34.
?>
35.
</table>
36.
<?php
37.
mssql_close(
$objConnect
);
38.
?>
39.
</body>
40.
</html>