I want to access an Oracle database that is on a remote Linux server with my company's intranet.
Currently I can access it through Excel and a System DSN on my Windows 7 machine. But I am running into difficulties with multiple queries in my excel spreadsheet, so I want to create a web page that does the same thing using PHP.
I have the name of the server that the DB is on, but I cannot get any response, either good or bad from my queries. I have read about web
Here is an example of the connection script:
//Data Source=username/password@//myserver:1521/my.service.com;
echo "set up db connection.<Br>";
$db = oci_connect('userid', 'password', 'server/db');
if (!$db) {
echo "no db. <br>";
$e = oci_error();
if (!$e) {
echo "no oci errors. <br>";
}
else {
trigger_error(htmlentities($e['message'], ENT_QUOTES), E_USER_ERROR);
}
}
else {
echo "DB, yes <br>";
}
if ($db->connect_error) {
echo "Connection errors. <br>";
die('Connect Error ('. $db->connect_errno .') '. $db->connect_error);
}
else {
echo "no connection errors.<br>";
}
echo 'Success, db info: '. $db->host_info .'.<br>';