0

I would like to connect to an Oracle DB from PHP using the oci8 module (oci_connect). I know how to do this, but the problem is I would like to do it dynamically based on a connection string of type

"oci8://user_name:password@tns_name"

The oci_connect method needs the user_name, password and the tns_name (called connection string) separately. I would prefer not to parse my connection string to make the code more robust.

Is there a way to do this ?

By the way, I'm using PHP 5.2.5 and Oracle 10g and I'm using the oci8 module to help me call a stored procedure.

Adrian
  • 23
  • 4

1 Answers1

0

Your code willbe more robust WHEN you parse your string, because you can detect invalid connection information

bish
  • 3,381
  • 9
  • 48
  • 69
  • Not exactly what I expected... I think that a good php function can do some "magic" and adapt to different kind of connection string, my parsing won't. Still, thank you for your answer. Will mark it as resolved. – Adrian Jun 14 '13 at 06:46