oci_connect

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
tdsrogers
Forum Newbie
Posts: 11
Joined: Sat Mar 06, 2010 12:44 pm

oci_connect

Post 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
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Re: oci_connect

Post 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.
tdsrogers
Forum Newbie
Posts: 11
Joined: Sat Mar 06, 2010 12:44 pm

Re: oci_connect

Post 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.
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Re: oci_connect

Post 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.
Post Reply