By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,188 Members | 831 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,188 IT Pros & Developers. It's quick & easy.

can oci_connect be in a function?

P: 27
I have a oracle/php question

I'm moving a site from postgres/mysql to oracle.

In the past I've written a funtion for my database connection and stored it in initialize.php then I included the file on pages where I need to use the function. The function follows:

Expand|Select|Wrap|Line Numbers
  1. function initialize() {
  2.    $user= ***;
  3.    $pass=***;
  4.    $host=***;
  5. $db = pg_connection($user $pass $host);
  6. //$db = oci_connect($user, $pass, $host);
  7. }
  8.  
The thing is I am trying to use oracel and if $db = pg_connect is replace with $db = oci_connect inside of the function I get errors. If it is written in the same file, but not in a function it works.

My question is why doesn't oracle allow me to call the oci_connect within a function or am I just doing something wrong.
Jan 8 '08 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.