Hi there,
I will use the PEAR:😃B class to connect to an oracle Database. I try it first with mysql and it works fine.
Here is the part of the code:
require_once("DB.php");
.user
.pass
......
$dsn = "mysql://$user:$pass@$host/$dbname";
$query = "select monat from TOP10_ZIELADDR";
$db = DB::connect($dsn);
$result = $db->query($query);
$db->setFetchMode(DB_FETCHMODE_ASSOC);
while($row = $result->fetchRow()) {
print $row["MONAT"] . "<i>" . "<br>";
}
Now I will use the same code for oracle with some changes,but the method "query" is not known by php if i use this part of code:
require_once("DB.php");
.user
.pass
......
$query = "select eclass from category_mapping";
$dsn = "oci8://$user:$pass@$host/$dbname";
$db = DB::connect($dsn);
$result = $db->query($query);
$db->setFetchMode(DB_FETCHMODE_ASSOC);
while($row = $result->fetchRow()) {
print $row["ECLASS"] . "<i>" . "<br>";
}
PHP says : Fatal error: Call to undefined function: query()
Why ? I thought PEAR:😃B is an abtract databaselayer ? What is my mistake ? Can anybody help me ?
THX
Greetings Timeless