<html>
<body>
<?php
$conn=odbc_connect('ktv','','');
if (!$conn){
exit("Connection Failed: " . $conn);
}
$sql="SELECT * FROM tb_authorinfo";
$rs=odbc_exec($conn,$sql);
if (!$rs){
exit("Error in SQL");
}
echo "<table><tr>";
echo "<th>ID</th><th>Name</th><th>Sex</th><th>Birthday</th><th>Genre</th><th>Company</th><th>Recma</th><th>zjm</th><th>DateTime</th>";
echo "</tr>";
while (odbc_fetch_row($rs)){
$id=odbc_result($rs,"authorId");
$name=odbc_result($rs,"authorName");
$sex=odbc_result($rs,"authorSex");
$birthday=odbc_result($rs,"authorbirthday");
$genre=odbc_result($rs,"authorGenre");
$company=odbc_result($rs,"authorcompany");
$recma=odbc_result($rs,"authorRecma");
$zjm=odbc_result($rs,"authorzjm");
$datetime=odbc_result($rs,"RdateTime");
echo "<tr><td>$id</td><td>$name</td><td>$sex</td><td>$birthday</td><td>$genre</td><td>$company</td><td>$recma</td><td>$zjm</td><td>$datetime</td>";
echo "</tr>";
}
odbc_close($conn);
echo "</table>";
?>
</body>
</html>
结果如下:
ID | Name | Sex | Birthday | Genre | Company | Recma | zjm | DateTime |
AU-4122007110244 |
张 |
男 |
2007-12-04 11:11:33 |
大陆 |
武打 |
|
Z |
2007-12-04 11:47:45 |
AU-10122007115114 |
小星 |
男 |
1789-12-10 11:51:14 |
海外 |
喜剧 |
无 |
XX |
2007-12-10 11:51:50 |
AU-10122007131630 |
小李 |
女 |
2007-12-10 13:16:30 |
大陆 |
经典 |
无 |
XL |
2007-12-10 13:16:44 |
posted on 2009-07-03 10:50
期待明天 阅读(992)
评论(0) 编辑 收藏 所属分类:
PHP