Exemple #1
0
/**
 * mechanism to use "super user" for SQL queries related to password operations
 * 
 * @param type $sql
 * @param type $params
 * @return type
 */
function privStatement($sql, $params = null)
{
    if (is_array($params)) {
        $recordset = getPrivDB()->Execute($sql, $params);
    } else {
        $recordset = getPrivDB()->Execute($sql);
    }
    if ($recordset === FALSE) {
        // These error messages are explictly NOT run through xl() because we still
        // need them if there is a database problem.
        echo "Failure during database access! Check server error log.";
        error_log("Executing as user:"******" Statement failed:" . $sql . ":");
        exit;
    }
    return $recordset;
    return sqlStatement($sql, $params);
}
Exemple #2
0
/**
 * mechanism to use "super user" for SQL queries related to password operations
 * 
 * @param type $sql
 * @param type $params
 * @return type
 */
function privStatement($sql, $params = null)
{
    if (is_array($params)) {
        $recordset = getPrivDB()->Execute($sql, $params);
    } else {
        $recordset = getPrivDB()->Execute($sql);
    }
    if ($recordset === FALSE) {
        // These error messages are explictly NOT run through xl() because we still
        // need them if there is a database problem.
        echo "Failure during database access! Check server error log.";
        $backtrace = debug_backtrace();
        error_log("Executing as user:"******" Statement failed:" . $sql . ":" . $GLOBALS['last_mysql_error'] . "==>" . $backtrace[1]["file"] . " at " . $backtrace[1]["line"] . ":" . $backtrace[1]["function"]);
        exit;
    }
    return $recordset;
    return sqlStatement($sql, $params);
}