<?php
include_once(“DB/mysql.php”);
$dbh = db_connect(array($host,$user,$pass));
if (!$dbh){
die(“Cannot connect to database”);
}
db_select_db(array(“sampleDB”));
$sth = db_query(“SELECT * FROM sampleTable”, $dbh);
if (!$sth) {
die(“Cannot execute query”);
}
while ($row = db_fetch_row(array($sth))) {
echo $row[“firstname”];
echo $row[“lastname”];
}
db_free_result(array($sth));
db_close(array($dbh));
?>