Page 1 of 1

oci_connect

Posted: Sat Mar 06, 2010 12:51 pm
by tdsrogers
Hi
Ive created an XML document in Oracle isql*plus and want to connect to it using PHP. Im fairly new to PHP and have attempted to connect using $con = oci_connect('Username', Password', 'localhost/XE'); but nothing appears to happen. Am I doing something wrong?
Any help would be appreciated, Im slowly going insane!
Thom R

Re: oci_connect

Posted: Sat Mar 06, 2010 12:55 pm
by John Cartwright
Define "nothing happens", surely.. something is happening ;)

Do you have error reporting enabled, i.e.,

Code: Select all

error_reporting(E_ALL);
 
As well as error catching, i.e.,

Code: Select all

 
$conn = oci_connect('Username', 'Password', 'localhost/XE');
if (!$conn) {
    $e = oci_error();
    trigger_error(htmlentities($e['message'], ENT_QUOTES), E_USER_ERROR);
}
Although I suspect it was a typo in your post, you were missing a quote around your username.

Re: oci_connect

Posted: Sat Mar 06, 2010 1:06 pm
by tdsrogers
Ive tried the exact same code as you have suggested but I keep getting a blank page even with error reporting. It quite literally returns nothing.

Re: oci_connect

Posted: Sat Mar 06, 2010 5:33 pm
by John Cartwright
You likely have a parse error, with error reporting disabled. You will need to enable it in your php.ini (display_errors config value) to see fatal errors.