• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP pg_ErrorMessage函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中pg_ErrorMessage函数的典型用法代码示例。如果您正苦于以下问题:PHP pg_ErrorMessage函数的具体用法?PHP pg_ErrorMessage怎么用?PHP pg_ErrorMessage使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了pg_ErrorMessage函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: pgquery

 function pgquery($query)
 {
     $result = pg_exec($this->pgcon(), $query);
     if (!$result) {
         $this->mydie("Could not successfully run query ({$query}) from DB: " . pg_ErrorMessage());
     }
     return $result;
 }
开发者ID:najamelan,项目名称:vhffs-4.5,代码行数:8,代码来源:VHFFSAuthPlugin.php


示例2: pg_db_send_query

 function pg_db_send_query($iConn, $sQry)
 {
     $iQuery = @pg_send_query($iConn, $sQry);
     if (!$iQuery) {
         $erro = pg_ErrorMessage($iConn) . "\n" . $sQry;
         msgErro($erro);
     }
     return $iQuery;
 }
开发者ID:brunopagno,项目名称:everydayvis,代码行数:9,代码来源:postgresql.php


示例3: exec_query

function exec_query($connection, $query)
{
    $result = pg_Exec($connection, $query);
    if (!$result) {
        echo "Connection to database failed.";
        echo pg_ErrorMessage($connection);
        return 0;
    }
    return $result;
}
开发者ID:pierrechtux,项目名称:QCV,代码行数:10,代码来源:database_functions.php


示例4: StandaloneQuery

 function StandaloneQuery(&$db, $query)
 {
     if (($connection = $db->DoConnect("template1", 0)) == 0) {
         return 0;
     }
     if (!($success = @pg_Exec($connection, "{$query}"))) {
         $db->SetError("Standalone query", pg_ErrorMessage($connection));
     }
     pg_Close($connection);
     return $success;
 }
开发者ID:BackupTheBerlios,项目名称:zvs,代码行数:11,代码来源:manager_pgsql.php


示例5: connect

 function connect()
 {
     if ($this->isConnected()) {
         $this->setError("sqLink->connect(0): Already connected.");
         return false;
     }
     if ($this->db_host) {
         $this->db_host = "host = " . $this->db_host;
     }
     $this->db_link = pg_connect($this->db_host . ' dbname = ' . $this->db_name . ' user = ' . $this->db_user . ' password = ' . $this->db_pass);
     if ($this->db_link) {
         return true;
     } else {
         pg_close($this->db_link);
         $this->setError("Error: sqLink->connect(2) PSQL - " . pg_ErrorMessage($this->db_link));
         return false;
     }
 }
开发者ID:mmr,项目名称:b1n,代码行数:18,代码来源:sql_link.inc.php


示例6: connect

 function connect()
 {
     if ($this->isConnected()) {
         user_error('sqLink->connect(0): Already connected.');
         return false;
     }
     if ($this->db_host) {
         $this->db_host = "host = " . $this->db_host;
     }
     $this->db_link = pg_connect($this->db_host . " dbname = " . $this->db_name . " user = " . $this->db_user . " password = " . $this->db_pass);
     if ($this->db_link) {
         return true;
     } else {
         pg_close($this->db_link);
         user_error("Error: sqLink->connect(2)PSQL - " . pg_ErrorMessage($this->db_link));
         return false;
     }
 }
开发者ID:mmr,项目名称:b1n,代码行数:18,代码来源:sqllink.lib.php


示例7: metadata

 function metadata($table = "")
 {
     $count = 0;
     $id = 0;
     $res = array();
     if ($table) {
         $this->connect();
         $id = pg_exec($this->Link_ID, "SELECT * FROM {$table}");
         if ($id < 0) {
             $this->Error = pg_ErrorMessage($id);
             $this->Errno = 1;
             $this->halt("Metadata query failed.");
         }
     } else {
         $id = $this->Query_ID;
         if (!$id) {
             $this->halt("No query specified.");
         }
     }
     $count = pg_NumFields($id);
     for ($i = 0; $i < $count; $i++) {
         $res[$i]["table"] = $table;
         $res[$i]["name"] = pg_FieldName($id, $i);
         $res[$i]["type"] = pg_FieldType($id, $i);
         $res[$i]["len"] = pg_FieldSize($id, $i);
         $res[$i]["flags"] = "";
     }
     if ($table) {
         pg_FreeResult($id);
     }
     return $res;
 }
开发者ID:BackupTheBerlios,项目名称:core-svn,代码行数:32,代码来源:cls_db_pgsql.php


示例8: die

if (!file_exists($filename) || filemtime($filename) + $period < time()) {
    // get graph information
    global $db;
    // XXX CHANGE THE QUERY XXX
    $data = @pg_exec($db, "select query, title, label, is_clickable from graphs where id = {$id}") or die("PGERR 1: " . pg_ErrorMessage());
    if (pg_numrows($data) == 0) {
        die("GRAPH: invalid id");
    }
    $r = pg_fetch_row($data, $i);
    $query = $r[0];
    $title = $r[1];
    $axislabel = $r[2];
    $is_clickable = $r[3];
    pg_freeresult($data);
    // get graph data
    $data = @pg_exec($db, $query) or die("PGERR 2: " . pg_ErrorMessage());
    $v = array();
    $l = array();
    $u = array();
    for ($i = 0; $i < pg_numrows($data); $i++) {
        $r = pg_fetch_row($data, $i);
        array_push($v, $r[1]);
        array_push($l, $r[0] . "  ");
        array_push($u, $r[2]);
    }
    pg_freeresult($data);
    // draw
    $map = FreshPortsChart($title, $axislabel, $v, $l, $u, $filename);
    if ($is_clickable == 't') {
        // save map
        $fp = fopen($cache_dir . $fid . ".map", "w");
开发者ID:brycied00d,项目名称:freshports,代码行数:31,代码来源:graph.php


示例9: metadata

 function metadata($table)
 {
     $count = 0;
     $id = 0;
     $res = array();
     $this->connect();
     $id = pg_exec($this->Link_ID, "select * from {$table} LIMIT 1");
     if ($id < 0) {
         $this->Error = pg_ErrorMessage($id);
         $this->Errno = 1;
         $this->Errors->addError("Metadata query failed: " . $this->Error);
         return 0;
     }
     $count = pg_NumFields($id);
     for ($i = 0; $i < $count; $i++) {
         $res[$i]["table"] = $table;
         $res[$i]["name"] = pg_FieldName($id, $i);
         $res[$i]["type"] = pg_FieldType($id, $i);
         $res[$i]["len"] = pg_FieldSize($id, $i);
         $res[$i]["flags"] = "";
     }
     pg_FreeResult($id);
     return $res;
 }
开发者ID:rayminami,项目名称:chumanis,代码行数:24,代码来源:db_pgsql.php


示例10: errDie

/**
 * reports ands logs error
 *
 * skip the log of there are filesystem problems.
 *
 * @param string $err
 * @param bool $skiplog
 */
function errDie($errstring, $skiplog = false)
{
    $err = DATE_LOGGING . " - " . SELF . " - {$errstring}";
    if (pg_ErrorMessage()) {
        $err .= " - " . pg_ErrorMessage();
    }
    // log error to file
    die($errstring);
    if ($skiplog === false && ($fd = cfs::fopen("error_log", 'a'))) {
        if (cfs::fwrite($fd, "{$err}\n")) {
            $errlog_msg = "Error has been logged. Please notify the administrator.";
        } else {
            $errlog_msg = "Error writing to error log. Please notify the administrator.";
        }
        cfs::fclose($fd);
    } else {
        $errlog_msg = "Error opening error log. Please notify the administrator.";
    }
    $OUTPUT = "{$errstring} {$errlog_msg}";
    require "newtemplate.php";
}
开发者ID:andrecoetzee,项目名称:accounting-123.com,代码行数:29,代码来源:newsettings.php


示例11: _getLobValue

 /**
  * Convert a text value into a DBMS specific format that is suitable to
  * compose query statements.
  *
  * @param resource  $prepared_query query handle from prepare()
  * @param           $parameter
  * @param           $lob
  * @return string text string that represents the given argument value in
  *      a DBMS specific format.
  * @access private
  */
 function _getLobValue($prepared_query, $parameter, $lob)
 {
     $connect = $this->connect();
     if (MDB::isError($connect)) {
         return $connect;
     }
     if ($this->auto_commit && !@pg_exec($this->connection, 'BEGIN')) {
         return $this->raiseError(MDB_ERROR, NULL, NULL, '_getLobValue: error starting transaction');
     }
     if ($lo = @pg_locreate($this->connection)) {
         if ($handle = @pg_loopen($this->connection, $lo, 'w')) {
             while (!$this->endOfLob($lob)) {
                 $result = $this->readLob($lob, $data, $this->options['lob_buffer_length']);
                 if (MDB::isError($result)) {
                     break;
                 }
                 if (!@pg_lowrite($handle, $data)) {
                     $result = $this->raiseError(MDB_ERROR, NULL, NULL, 'Get LOB field value: ' . @pg_errormessage($this->connection));
                     break;
                 }
             }
             @pg_loclose($handle);
             if (!MDB::isError($result)) {
                 $value = strval($lo);
             }
         } else {
             $result = $this->raiseError(MDB_ERROR, NULL, NULL, 'Get LOB field value: ' . @pg_errormessage($this->connection));
         }
         if (MDB::isError($result)) {
             $result = @pg_lounlink($this->connection, $lo);
         }
     } else {
         $result = $this->raiseError(MDB_ERROR, NULL, NULL, 'Get LOB field value: ' . pg_ErrorMessage($this->connection));
     }
     if ($this->auto_commit) {
         @pg_exec($this->connection, 'END');
     }
     if (MDB::isError($result)) {
         return $result;
     }
     return $value;
 }
开发者ID:ookwudili,项目名称:chisimba,代码行数:53,代码来源:pgsql.php


示例12: _generate_csv

 function _generate_csv($query_string, $dbname = "mysql", $user = "root", $password = "", $host = "localhost")
 {
     /*echo " dbname=cdrasterisk host=db01.fr4.egwn.net user=ivr password=7Q8GFTK9fq </br>$query_string<br>";
       $ConnId = pg_connect("dbname=cdrasterisk host=db01.fr4.egwn.net user=ivr password=7Q8GFTK9fq");
       $ResId = pg_query ($ConnId, $query_string);
       if (!$ResId) pg_ErrorMessage($ResId);
       pg_close ($ConnId);
       $row = pg_fetch_array ($ResId, 4);
       print_r($row);
       exit();*/
     if (!($conn = $this->_db_connect($dbname, $user, $password, $host))) {
         die("Error. Cannot connect to Database.");
     } else {
         //$result = @mysql_query($query_string, $conn);
         $result = pg_query($conn, $query_string);
         if (!$result) {
             die("Could not perform the Query: " . pg_ErrorMessage($result));
             //die("Could not perform the Query: ".mysql_error());
         } else {
             $file = "";
             $crlf = $this->_define_newline();
             //while ($str= @mysql_fetch_array($result, MYSQL_NUM))
             while ($str = @pg_fetch_array($result, NULL, PGSQL_NUM)) {
                 $file .= $this->arrayToCsvString($str, ",") . $crlf;
             }
             echo $file;
         }
     }
 }
开发者ID:shinichi85,项目名称:voiperopen,代码行数:29,代码来源:iam_csvdump.php


示例13: halt

 function halt($msg, $line = '', $file = '')
 {
     /* private: error handling */
     if ($this->Halt_On_Error == 'no') {
         $this->Error = @pg_ErrorMessage($this->Link_ID);
         $this->Errno = 1;
         return;
     }
     /* Just in case there is a table currently locked */
     $this->transaction_abort();
     if ($this->xmlrpc || $this->soap) {
         $s = sprintf("Database error: %s\n", $msg);
         $s .= sprintf("PostgreSQL Error: %s\n\n (%s)\n\n", $this->Errno, $this->Error);
     } else {
         $s = sprintf("<b>Database error:</b> %s<br>\n", $msg);
         $s .= sprintf("<b>PostgreSQL Error</b>: %s (%s)<br>\n", $this->Errno, $this->Error);
     }
     if ($file) {
         if ($this->xmlrpc || $this->soap) {
             $s .= sprintf("File: %s\n", $file);
         } else {
             $s .= sprintf("<br><b>File:</b> %s", $file);
         }
     }
     if ($line) {
         if ($this->xmlrpc || $this->soap) {
             $s .= sprintf("Line: %s\n", $line);
         } else {
             $s .= sprintf("<br><b>Line:</b> %s", $line);
         }
     }
     if ($this->Halt_On_Error == 'yes') {
         if (!$this->xmlrpc && !$this->soap) {
             $s .= '<p><b>Session halted.</b>';
         }
     }
     if ($this->xmlrpc) {
         xmlrpcfault($s);
     } elseif ($this->soap) {
     } else {
         echo $s;
         //$GLOBALS['phpgw']->common->phpgw_exit(True);
     }
 }
开发者ID:helenadeus,项目名称:s3db.map,代码行数:44,代码来源:class.db_pgsql.inc.php


示例14: errDie

function errDie($usrString)
{
    $ERROR = DATE_LOGGING . " - " . SELF . " - " . USER_NAME . " - " . $usrString;
    // Create error from scriptname & user string
    if (pg_ErrorMessage()) {
        $ERROR .= " - " . pg_ErrorMessage();
    }
    // log error to file
    $ERROR_LOG = fopen("error_log", 'a') or die("ERROR while opening error_log. Please notify the administrator.");
    flock($ERROR_LOG, LOCK_EX) or die("ERROR obtaining file lock on error_log. Please notify the administrator.");
    fwrite($ERROR_LOG, $ERROR . "\n") or die("ERROR writing to error_log. Please notify the administrator.");
    flock($ERROR_LOG, LOCK_UN);
    fclose($ERROR_LOG);
    $OUTPUT = $usrString . " Error has been logged, please notify the administrator.";
    require "template.php";
}
开发者ID:andrecoetzee,项目名称:accounting-123.com,代码行数:16,代码来源:setting_old.php


示例15: pg_connect

<?php

$link = pg_connect("host=localhost port=5432 password=ICInf-551 user=icinf5 dbname=icinf5");
if (!$link) {
    die(' Error al conectarse ' . pg_ErrorMessage($link));
}
开发者ID:0fbn,项目名称:proyecto-isw,代码行数:6,代码来源:conexion.php


示例16: db_redireciona

    }
    if ($db_verifica_ip == "0") {
        if ($cgccpf == "") {
            db_redireciona('digitaitbi.php?' . base64_encode('erroscripts=Informe o CNPJ/CPF do contribuinte.'));
            exit;
        }
    }
    if (!isset($matricula) or empty($matricula) or !is_int(0 + $matricula)) {
        db_logs("", "", 0, "Variavel Matricula Invalida.");
        db_redireciona("digitatbi.php?" . base64_encode("erroscripts=Os dados informados não conferem, verifique!"));
    }
    $cgccpf = str_replace(".", "", $cgccpf);
    $cgccpf = str_replace("/", "", $cgccpf);
    $cgccpf = str_replace("-", "", $cgccpf);
    $sql_exe = "select ident from db_config";
    $result = pg_exec($sql_exe) or die("Erro: " . pg_ErrorMessage($conn));
    db_fieldsmemory($result, 0);
    /*
      $sql_exe = "select * from iptubase,cgm
                         where j01_matric = $matricula and 
                                   j01_numcgm = z01_numcgm ";
        if ( $db_verifica_ip == "0" ) {
          $sql_exe = $sql_exe . " and trim(z01_cgccpf) = '$cgccpf' and trim(z01_cgccpf) != ''";
        }
      $result = pg_exec($sql_exe) or die("Erro: ".pg_ErrorMessage($conn));
    */
    $result = $cliptubase->sql_record($cliptubase->sql_query("", "*", "", "iptubase.j01_matric = {$matricula} and j01_numcgm = z01_numcgm"));
} else {
    /*
    $result = pg_exec("select * from iptubase,cgm
                         where j01_matric = $matricula and 
开发者ID:arendasistemasintegrados,项目名称:mateusleme,代码行数:31,代码来源:opcoesitbi.php


示例17: query

 function query($query)
 {
     if ($this->db_type == "mysql") {
         $this->results = mysql_query($query, $this->conn);
         $this->numFields = mysql_num_fields($this->results);
     } else {
         $this->results = pg_query($this->conn, $query);
         if (!$this->results) {
             die("Could not perform the Query: " . pg_ErrorMessage($this->results));
         }
         $this->numFields = pg_num_fields($this->results);
     }
 }
开发者ID:hardikk,项目名称:HNH,代码行数:13,代码来源:export_pdf.php


示例18: Setup

 function Setup()
 {
     if (!function_exists("pg_connect")) {
         return "PostgreSQL support is not available in this PHP configuration";
     }
     $this->supported["Sequences"] = $this->supported["Indexes"] = $this->supported["SummaryFunctions"] = $this->supported["OrderByText"] = $this->supported["Transactions"] = $this->supported["GetSequenceCurrentValue"] = $this->supported["SelectRowRanges"] = $this->supported["LOBs"] = $this->supported["Replace"] = $this->supported["AutoIncrement"] = $this->supported["PrimaryKey"] = $this->supported["OmitInsertKey"] = $this->supported["OmitInsertKey"] = $this->supported["PatternBuild"] = 1;
     if (function_exists("pg_cmdTuples")) {
         if ($connection = $this->DoConnect("template1", 0)) {
             if ($result = @pg_Exec($connection, "BEGIN")) {
                 $error_reporting = error_reporting(63);
                 @pg_cmdTuples($result);
                 if (!isset($php_errormsg) || strcmp($php_errormsg, "This compilation does not support pg_cmdtuples()")) {
                     $this->supported["AffectedRows"] = 1;
                 }
                 error_reporting($error_reporting);
             } else {
                 $this->SetError("Setup", pg_ErrorMessage($connection));
             }
             pg_Close($connection);
         } else {
             $result = 0;
         }
         if (!$result) {
             return $this->Error();
         }
     }
     if (isset($this->options["EmulateDecimal"]) && $this->options["EmulateDecimal"]) {
         $this->emulate_decimal = 1;
         $this->decimal_factor = pow(10.0, $this->decimal_places);
     }
     return "";
 }
开发者ID:wycus,项目名称:darmedic,代码行数:32,代码来源:metabase_pgsql.php


示例19: debitos_inscricao_var

function debitos_inscricao_var($inscricao, $limite, $tipo, $datausu, $anousu)
{
    $sql = "select *,\n                 substr(fc_calcula,2,13)::float8 as vlrhis,\n                 substr(fc_calcula,15,13)::float8 as vlrcor,\n                 substr(fc_calcula,28,13)::float8 as vlrjuros,\n                 substr(fc_calcula,41,13)::float8 as vlrmulta,\n                 substr(fc_calcula,54,13)::float8 as vlrdesconto,\n                 (substr(fc_calcula,15,13)::float8+\n                 substr(fc_calcula,28,13)::float8+\n                 substr(fc_calcula,41,13)::float8-\n                 substr(fc_calcula,54,13)::float8) as total\n          from (  \n          select q05_aliq,''::bpchar as k00_matric,v.q05_vlrinf as valor_variavel,a.k00_inscr,i.*,histcalc.*,tabrec.k02_descr,fc_calcula(i.k00_numpre,i.k00_numpar,i.k00_receit,'" . date('Y-m-d', $datausu) . "','" . db_vencimento($datausu) . "'," . $anousu . ") \n          from arreinscr a\n                             inner join arrecad i on a.k00_numpre = i.k00_numpre \n                                 left outer join issvar v on v.q05_numpre = i.k00_numpre and v.q05_numpar = i.k00_numpar\n                                 ,histcalc,tabrec  inner join tabrecjm on tabrecjm.k02_codjm = tabrec.k02_codjm\n          where k00_hist   = k01_codigo and \n                        a.k00_inscr = {$inscricao} and\n                                k00_receit = k02_codigo ";
    if ($tipo != 0) {
        $sql .= " and k00_tipo   = " . $tipo;
    }
    $sql .= " order by k00_numpre,k00_numpar,k00_dtvenc";
    if ($limite != 0) {
        $sql .= " limit " . $limite;
    }
    $sql .= ") as x";
    $result = pg_query($sql) or die("Sql : " . pg_ErrorMessage($result));
    if ($limite == 0) {
        if (pg_numrows($result) == 0) {
            false;
        }
        return $result;
    } else {
        if (pg_numrows($result) == 0) {
            return false;
        } else {
            return 1;
        }
    }
}
开发者ID:arendasistemasintegrados,项目名称:mateusleme,代码行数:25,代码来源:db_sql.php


示例20: trim

     $sql_exe = " select *                         ";
     $sql_exe .= "   from issbase,                  ";
     $sql_exe .= "        cgm                       ";
     $sql_exe .= "  where q02_inscr  = {$inscricao}   ";
     $sql_exe .= "    and q02_numcgm = z01_numcgm   ";
     if ($db_verifica_ip == "0") {
         $sql_exe = $sql_exe . " and trim(z01_cgccpf) = '{$cgccpf}'";
     }
     $result = db_query($sql_exe) or die("Erro: " . pg_ErrorMessage($conn));
 } else {
     if (isset($inscricao) != "") {
         $sql = " select * from issbase,                 ";
         $sql .= "               cgm                      ";
         $sql .= "   where q02_inscr = {$inscricao} and   ";
         $sql .= "\t      q02_numcgm = z01_numcgm        ";
         $result = db_query($sql) or die("Erro: " . pg_ErrorMessage($conn));
     }
     $cgccpf = trim(pg_result($result, 0, 'z01_cgccpf'));
 }
 if (pg_numrows($result) == 0) {
     $sUrl = base64_encode("id_usuario=''&erroscripts=Dados Inconsistentes na Inscrição Número: " . $inscricao . ".");
     db_logs("", "{$inscricao}", 0, "Dados Inconsistentes na Inscricao Numero: {$inscricao}");
     db_redireciona("digitainscricao.php?" . $sUrl);
     $script = false;
 } else {
     if (pg_result($result, 0, "z01_cgccpf") == "00000000000000" || pg_result($result, 0, "z01_cgccpf") == "              " || trim(pg_result($result, 0, "z01_cgccpf")) != "{$cgccpf}") {
         $script = true;
     }
     if (pg_numrows($result) > 0) {
         db_fieldsmemory($result, 0);
         db_logs("", "{$inscricao}", 0, "Inscricao Pesquisada. Numero: {$inscricao}");
开发者ID:arendasistemasintegrados,项目名称:mateusleme,代码行数:31,代码来源:opcoescertidao.php



注:本文中的pg_ErrorMessage函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP pg_Exec函数代码示例发布时间:2022-05-15
下一篇:
PHP pg_Connect函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap