From ade22203c5f721a756ada25263e53f7f3a4f32b5 Mon Sep 17 00:00:00 2001 From: Alejandro Gallardo Escobar Date: Tue, 2 Jun 2015 18:02:38 +0200 Subject: [PATCH] Added a new option to the db connection function --- pandora_console/include/db/oracle.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pandora_console/include/db/oracle.php b/pandora_console/include/db/oracle.php index 245a8db553..05dd613adb 100644 --- a/pandora_console/include/db/oracle.php +++ b/pandora_console/include/db/oracle.php @@ -14,7 +14,7 @@ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -function oracle_connect_db($host = null, $db = null, $user = null, $pass = null, $port = null) { +function oracle_connect_db($host = null, $db = null, $user = null, $pass = null, $port = null, $new_connection = true) { global $config; if ($host === null) @@ -30,7 +30,11 @@ function oracle_connect_db($host = null, $db = null, $user = null, $pass = null, // Non-persistent connection: This will help to avoid mysql errors like "has gone away" or locking problems // If you want persistent connections change it to oci_pconnect(). - $connect_id = oci_new_connect($user, $pass, '//' . $host . ':' . $port . '/' . $db); + if ($new_connection) + $connect_id = oci_new_connect($user, $pass, '//' . $host . ':' . $port . '/' . $db); + else + $connect_id = oci_connect($user, $pass, '//' . $host . ':' . $port . '/' . $db); + if (! $connect_id) { return false; }