示例#1
0
文件: mysql.php 项目: gblok/rsc
function db_phquery()
{
    $args = func_get_args();
    $tmpl = array_shift($args);
    $sql = sql_placeholder_ex($tmpl, $args, $error);
    if ($sql === false) {
        $sql = PLACEHOLDER_ERROR_PREFIX . $error;
    }
    //   fbug($sql);
    return db_query($sql);
}
示例#2
0
function sql_pholder()
{
    $args = func_get_args();
    $tmpl = array_shift($args);
    $result = sql_placeholder_ex($tmpl, $args, $error);
    if ($result === false) {
        $error = "Placeholder substitution error. Diagnostics: \"{$error}\"";
        if (function_exists("debug_backtrace")) {
            $bt = debug_backtrace();
            $error .= " in " . @$bt[0]['file'] . " on line " . @$bt[0]['line'];
        }
        trigger_error($error, E_USER_WARNING);
        return false;
    }
    return $result;
}