Frage

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.

War es hilfreich?

Lösung

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

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top