';
return 0;
} else {
if ($limit > 0) {
if (!$offset || $offset < 0) {
$offset=0;
}
}
$res = ociexecute($stmt,$sys_db_oci_commit_mode);
if ( !$res ) {
echo $qstring.'
';
return 0;
}
else if ( strcmp(ocistatementtype($stmt),"SELECT")==0 ) {
//store fieldnames for use in db_fieldname and db_numfields
for ($i=0;$i 0) {
for ($i=0; $i<$offset; $i++) {
//burn them off
if (!ocifetchinto($stmt,$res)) {
//if no data be returned
//get out of loop
$more_data=false;
break;
}
}
}
//store the data into $sys_db_results[$stmt]
//this is needed since there is the possiblity of calling
//db_result($qhandle,$row,$field) with any $row value
//db_result and db_fetch_array could be rewritten to
//eliminate the need for fetching all of the data up front
$row=0;
while ($more_data) {
$more = ocifetchinto($stmt,$res,OCI_RETURN_NULLS+OCI_RETURN_LOBS);
//see if data is being returned && we are
//still within the requested $limit
if ( !$more || (($limit >= 0) && ($row >= $limit))) {
$more_data=false;
}
else {
//populate sys_db_results with an array that can be indexed
//by field number or field name
for ($col=0;$col 0) ) {
return db_result($res,0,0);
} else {
return 0;
}
}
/**
*
* Returns the last error from the database
*
*/
function db_error() {
global $conn,$stmt;
if ($stmt) {
$err= ocierror($stmt);
}
else if ($conn) {
$err= ocierror($conn);
}
else {
$err= ocierror();
}
if ($err) {
return $err['message'];
} else {
return false;
}
}
?>