<?
include "dbsource.inc.php";
include "dbsource_mysql.inc.php";
include "dbsource_oracle.inc.php";
// Creates an object for handling a connection to mysql
$db_mysql = new dbsource_mysql
(
"hostname",
"user",
"password",
"database"
);
// Creates an object for handling a connection to oracle
$db_oracle = new dbsource_oracle
(
"user",
"password",
"schema"
);
// Connect the mysql object to the database
$db_mysql->connect ();
// Make a simple query to the mysql database
$db_mysql->query ("select * from table");
// And show some results
while ($row = $db_mysql->fetchrow ())
echo $row["field"];
// And exactly the same for the oracle object
$db_oracle->connect ();
$db_oracle->query ("select * from table");
while ($row = $db_oracle->fetchrow ())
echo $row["field"];
// It also gives a simple debug tool to show html-formatted sql sentences
$db_oracle->querydebug ("select * from table where field like '%value%' and field2 = 2500;");
// Any contributions for other databases will be welcomed at lha@hexoplastia.com
?>
|