<?php
/**
* example.php
* @author Emmanuel Arana Corzo <emmanuel.arana@gmail.com>
*/
include("OracleDriver.class.php");
include("OracleRecordset.class.php");
if(!defined("TNS")) { define("TNS", "localservice"); }
if(!defined("USER")) { define("USER", "system"); }
if(!defined("PASS")) { define("PASS", "manager"); }
$oci = new OracleDriver(TNS, USER, PASS);
?>
<html>
<head>
<title>This is just an example</title>
</head>
<body>
<?php
$sql = "SELECT campo1, campo2" . chr(13);
$sql .= "FROM tablas" . chr(13);
if($oci->getConnStatus()) {
$rs = new OracleRecordset($oci->execute($sql));
echo "<table border='1'>" . chr(13);
while($rs->fetch()) {
echo "<tr>";
for($i = 0; $i < $rs->getNCols(); $i++) {
echo "<td>" . $rs->getResult($i + 1) . "</td>" . chr(13);
}
echo "</tr>";
}
echo "</table>" . chr(13);
unset($rs);
}
?>
</body>
</html>
|