|
This is the code I have so far:
<html>
<BODY BGCOLOR=#3399CC>
<head>
<title>CHS Master Inventory System</title>
</head>
<B><FONT SIZE=10><CENTER>CHS Master Inventory</CENTER></FONT SIZE></B>
<h1><i><u><center>UPS Table</center></u></i></h1>
<table>
<tr>
<th>Room/Area:</th><br>
<th>CHS ID:</th><br>
<th>Model:</th><br>
<th>Serial:</th><br>
<th>Manufacturer:</th>
</tr>
<?php
/* set's the variables for MySQL connection */
$dbhost = "localhost:3306"; // this is the server address and port
$dbuname = "root";// username
$dbpass = "hoover"; // password
$dbname = "chs";
/* Connects to the MySQL server */
$dbase = mysql_connect($dbhost, $dbuname, $dbpass);
/* Defines the Active Database for the Connection */
mysql_select_db($dbname, $dbase);
$sql = "SELECT * FROM ups";
$result = mysql_query($sql, $dbase) or die (mysql_error());
for ($i=0; $i<$result->numRows(); $i++) {
$array = $result->fetchRow(DB_FETCHMODE_ASSOC,$i);
?>
<tr>
<td><?php echo $array ['RmArea']; ?></td>
<td><?php echo $array ['ChsID']; ?></td>
<td><?php echo $array ['Model']; ?></td>
<td><?php echo $array ['Serial']; ?></td>
<td><?php echo $array ['Manuf']; ?></td>
</tr>
<?php
} // end: for
mysql_close($dbase);
?>
</table>
</body>
</html>
|