/**	
  * Execute an SQL query
  * @param String sql
  */
 public function exec($sql)
 {
     $this->debugInfo($sql);
     $stmt = ociparse($this->conn, $sql);
     $stmt_type = ocistatementtype($stmt);
     if (!ociexecute($stmt)) {
         trigger_error($this->lastError(), E_USER_ERROR);
         return 0;
     }
     return 1;
 }
function db_exec($qstring,$conn)
{
	global $strLastSQL,$dDebug;
	if ($dDebug===true)
		echo $qstring."<br>";
	$strLastSQL=$qstring;
	$stmt=ociparse($conn,$qstring);
	$stmt_type=ocistatementtype($stmt);
	if(!ociexecute($stmt))
	{
		trigger_error(db_error($conn), E_USER_ERROR);
		return 0;
	}
	else
		return 1;
}
示例#3
0
 /**
  * Executes given SQL statement. This is an overloaded method.
  *
  * @param string $sql SQL statement
  * @return resource Result resource identifier or null
  * @access protected
  */
 function _execute($sql)
 {
     $this->_statementId = @ociparse($this->connection, $sql);
     if (!$this->_statementId) {
         $this->_setError($this->connection);
         return false;
     }
     if ($this->__transactionStarted) {
         $mode = OCI_DEFAULT;
     } else {
         $mode = OCI_COMMIT_ON_SUCCESS;
     }
     if (!@ociexecute($this->_statementId, $mode)) {
         $this->_setError($this->_statementId);
         return false;
     }
     $this->_setError(null, true);
     switch (ocistatementtype($this->_statementId)) {
         case 'DESCRIBE':
         case 'SELECT':
             $this->_scrapeSQL($sql);
             break;
         default:
             return $this->_statementId;
             break;
     }
     if ($this->_limit >= 1) {
         ocisetprefetch($this->_statementId, $this->_limit);
     } else {
         ocisetprefetch($this->_statementId, 3000);
     }
     $this->_numRows = ocifetchstatement($this->_statementId, $this->_results, $this->_offset, $this->_limit, OCI_NUM | OCI_FETCHSTATEMENT_BY_ROW);
     $this->_currentRow = 0;
     $this->limit();
     return $this->_statementId;
 }
示例#4
0
}
$conn = oracle_login($PHPSPLOIT, "POOLED");
if (!$conn) {
    $conn = oracle_login($PHPSPLOIT, "DEDICATED");
}
if (!$conn) {
    $err = @oci_error();
    return error("ERROR: ocilogon(): %s", $err["message"]);
}
// Send query
$query = @ociparse($conn, $PHPSPLOIT['QUERY']);
if (!$query) {
    $err = @oci_error();
    return error("ERROR: ociparse(): %s", $err["message"]);
}
$statement_type = @ocistatementtype($query);
if (!ociexecute($query)) {
    $err = @oci_error($query);
    return error("ERROR: ociexecute(): %s", $err["message"]);
}
if ($statement_type == "SELECT") {
    $result = array();
    $obj = oci_fetch_array($query, OCI_ASSOC + OCI_RETURN_NULLS);
    $result[] = array_keys($obj);
    $result[] = array_values($obj);
    while ($line = oci_fetch_array($query, OCI_ASSOC + OCI_RETURN_NULLS)) {
        $result[] = array_values($line);
    }
    return array('GET', count($result) - 1, $result);
} else {
    $rows = @ocirowcount($query);
ocidefinebyname();
ocierror();
ociexecute();
ocifetch();
ocifetchinto();
ocifetchstatement();
ocifreecollection();
ocifreecursor();
ocifreedesc();
ocifreestatement();
ociinternaldebug();
ociloadlob();
ocilogoff();
ocilogon();
ocinewcollection();
ocinewcursor();
ocinewdescriptor();
ocinlogon();
ocinumcols();
ociparse();
ociplogon();
ociresult();
ocirollback();
ocirowcount();
ocisavelob();
ocisavelobfile();
ociserverversion();
ocisetprefetch();
ocistatementtype();
ociwritelobtofile();
ociwritetemporarylob();