I just want to know that Is it possible to reuse the connection that i already have? actually i am looking to save some temporary data before the final Commit. But i am not able to do that in PHP.
Here is some code:
class DBConfig {
var $conn = "";
public funciton __construct()
{
$this->conn = oci_connect('hr', 'welcome', 'localhost/XE');
}
public function save_temp_query($query)
{
$result = oci_parse($this->conn, $query);
$res = oci_execute($result, OCI_NO_AUTO_COMMIT);
return $res;
}
public function fetch_data($query)
{
$result = null;
if ($query) {
$result = oci_parse($this->conn, $query);
$r = oci_execute($result);
}
return $result;
}
public function save_commit_data()
{
return oci_commit($this->conn);
}
}
Now you can see the $this->conn
variable and its use this is how i am using this.
But every time i use this class then $this->conn
refreshed every time and i'm also losing my temp data. and i have googled a lot.
May this is same question: Ensure php session gets the same oracle session when using oci_pconnect
But that's not my requirement. Please help!!