<html>
<head>
<title></title>
</head>
<body>
<?php
include_once("clsCustomQuery.php");
$dbh = mysql_connect( "localhost", "username", "password" );
if( !$dbh )
print "Error: Could not connect to localhost: ". mysql_error() ."<br/>";
$sql = new clsCustomQuery( "myDBTable", $dbh );
?>
<table>
<?php
if( $sql->query("select * from employees") ){
foreach( $sql->fetchrows as $row ){ ?>
<tr align="center"> <?php
foreach( $sql->fetchfields as $field ){ ?>
<td><?php echo $row[ $field ]?></td> <?php
} ?>
</tr> <?php
}
}else{ ?>
<tr><td><?php echo sprintf("Error: detail %s on statement: %s", $sql->error, $sql->statement)?></td></tr> <?php
} ?>
</table>
</body>
</html>
|