Example #1
0
 function query_exec($query)
 {
     # IMPORT MYSQL PARAMETERS (NOTE: IT WORKS WITH ABSOLUTE PATH ONLY !!)
     include '../config/registry_oracle_db.php';
     # open connection to db
     //putenv("ORACLE_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0");
     $conn = OCILogOn($user_db, $password_db, $db) or die("Could not connect to Oracle database!") or die(ocierror());
     # execute the EXEC query
     $statement = ociparse($conn, $query);
     $risultato = ociexecute($statement);
     # close connection
     ocilogoff($conn);
     $a = 1;
     return $a;
 }
Example #2
0
function query_select3($query, $table)
{
    $flag_green = "img/flag-green.png";
    $flag_red = "img/flag-red.png";
    $rec = array();
    include './config/registry_oracle_db.php';
    # open connection to db
    $conn = OCILogOn($user_db, $password_db, $db) or die("Could not connect to Oracle database!") or die(ocierror());
    //$rec=array();
    # execute the EXEC query
    $statement = ociparse($conn, $query);
    $risultato = ociexecute($statement);
    if ($risultato) {
        ?>
    <tr class="patient">
        <td class="valore" width="50"><img src="<?php 
        echo $flag_green;
        ?>
" width="32" height="32"/></td>
        <td class="valore"><?php 
        echo "{$table}: OK";
        ?>
</td>
    </tr>
<?php 
    } else {
        $err = array();
        $err = ocierror($statement);
        $error_message = $err['message'];
        ?>
    <tr class="patient">
        <td class="valore" width="50"><img src="<?php 
        echo $flag_red;
        ?>
" width="32" height="32"/></td>
        <td class="valore"><?php 
        echo $table . ": " . $error_message;
        ?>
</td>
    </tr>
<?php 
    }
}