<html>
<head>
<meta HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=sjis">
<meta http-equiv="Content-Script-Type" content="text/javascript">
<link rel="stylesheet" type="text/css" href="style.css">
<title>4-1-1 売上テーブルの内容をすべて表示</title>
</head>
<body>
<h2>4-1-1 売上テーブルの内容をすべて表示</h2>
<p></p>
<form>
<input type="button" value=" 戻る " onClick="history.back()">
</form>
<p></p>
<table border="1">
<tr>
<th>ID</th>
<th>会社名</th>
<th>商品名</th>
<th>売上単価</th>
<th>個数</th>
<th>売上</th>
</tr>
<?php
$DSN = 'test1'; //データソース名
$DBUSER = ''; //ログインユーザー名 なし
$DBPASSWORD = ''; //パスワード なし
//Accessデータベースに接続
if (! $con = odbc_connect($DSN, $DBUSER, $DBPASSWORD)) {
exit("Accessデータベースに接続できませんでした!");
}
//SQLを組み立て
$sql = 'SELECT * FROM uriage';
//結果セットを取得
$rst = odbc_exec($con, $sql);
//結果セットからデータをループで読み込み
while (odbc_fetch_row($rst)) {
echo '<tr>';
echo '<td>'.odbc_result($rst, "id").'</td>';
echo '<td>'.odbc_result($rst, "com").'</td>';
echo '<td>'.odbc_result($rst, "name1").'</td>';
echo '<td>'.odbc_result($rst, "uritan").'</td>';
echo '<td>'.odbc_result($rst, "uriko").'</td>';
echo '<td>'.odbc_result($rst, "uriage").'</td>';
echo '</tr>';
}
//ODBCとの接続を解除
odbc_close($con);
?>
</table>
</body>
</html>