db = $DB; $this->user = $USER; $this->pass = $PASS; $this->open(); } function open(){ $conn = OCILogon($this->user,$this->pass,$this->db); $this->conn = $conn; if ($conn == false) { echo OCIError($conn); return false; }else return true; } function query($query) { $this->query = $query; $handler = OCIParse($this->conn,$query); OCIExecute($handler,OCI_DEFAULT); $i =0; while(OCIFetchInto($handler, $result, OCI_RETURN_NULLS + OCI_ASSOC)) { foreach($result as $key=>$value){ $k = strtolower($key); $ergebnis[$i][$k] = $value; } $i++; } return ($ergebnis); OCIFreeStatement($handler); OCILogoff($this->conn); } function insert($insert_stmt){ $handler = OCIParse($this->conn,$insert_stmt); if(!is_resource($handler) || !OCIExecute($handler)) { $this->error_msg = "SQL-Statement-Handler ist nicht korrekt"; echo $this->error_msg; return false; }else return true; OCIFreeStatement($handler); OCILogoff($this->conn); } } ?>