<?
header("Content-type: application/vnd.ms-excel");
// header('Content-type: application/csv'); //*** CSV ***//
header("Content-Disposition: attachment; filename=testing.xls");
?>
<html>
<body>
<?
$objConnect = mysql_connect("localhost","root","xxx") or die("Error Connect to Database");
mysql_query("SET NAMES UTF8");
$objDB = mysql_select_db("jhcis43f");
$strSQL = "SELECT a.cid, a.pid, a.prename,a.`name`,a.lname,a.sex,a.birth, a.typearea,b.date_diag,b.date_disch,b.chronic
FROM person a, chronic b
WHERE a.pid = b.pid
GROUP BY a.cid ORDER BY chronic DESC ";
$objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]");
?>
<table width="600" border="1">
<tr>
<th width="91"> <div align="center">cid </div></th>
<th width="98"> <div align="center">pid </div></th>
<th width="198"> <div align="center">prename </div></th>
<th width="97"> <div align="center">name </div></th>
<th width="59"> <div align="center">lname </div></th>
<th width="71"> <div align="center">birth </div></th>
</tr>
<?
while($objResult = mysql_fetch_array($objQuery))
{
?>
<tr>
<td><div align="center"><?=$objResult["cid"];?></div></td>
<td><?=$objResult["name"];?></td>
<td><?=$objResult["lname"];?></td>
<td><div align="center"><?=$objResult["birth"];?></div></td>
<td align="right"><?=$objResult["cid"];?></td>
<td align="right"><?=$objResult["pid"];?></td>
</tr>
<?
}
?>
</table>
<?
mysql_close($objConnect);
?>
</body>
</html>
Kotlin Introduction
ตอบลบKotlin Installation
Kotlin Variable
Kotlin Comments
Kotlin Datatypes
Kotlin String
Kotlin Array
Kotlin Operators