当前位置: 首页>>代码示例>>PHP>>正文


PHP pg_fetch_object函数代码示例

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


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

示例1: show_css_page

function show_css_page($dbconn, $diary_login)
{
    $sql = "SELECT u.uid, s.page_css FROM " . TABLE_SETTINGS . " AS s, " . TABLE_USERS . " AS u WHERE u.login='" . $diary_login . "' AND s.uid=u.uid LIMIT 1";
    $result = pg_query($dbconn, $sql) or die(pg_last_error($dbconn));
    $data = pg_fetch_object($result, NULL);
    echo $data->page_css;
}
开发者ID:BackupTheBerlios,项目名称:diarusie-svn,代码行数:7,代码来源:css.inc.php

示例2: fetchObject

 function fetchObject()
 {
     if (($object = pg_fetch_object($this->res)) != false) {
         return $object;
     } else {
         return false;
     }
 }
开发者ID:BackupTheBerlios,项目名称:twonineothree-svn,代码行数:8,代码来源:postgresql.php

示例3: fetch

 public function fetch()
 {
     if ($this->_fetchMode == jDbConnection::FETCH_CLASS) {
         if ($this->_fetchModeCtoArgs) {
             $res = pg_fetch_object($this->_idResult, null, $this->_fetchModeParam, $this->_fetchModeCtoArgs);
         } else {
             $res = pg_fetch_object($this->_idResult, null, $this->_fetchModeParam);
         }
     } else {
         if ($this->_fetchMode == jDbConnection::FETCH_INTO) {
             $res = pg_fetch_object($this->_idResult);
             $values = get_object_vars($res);
             $res = $this->_fetchModeParam;
             foreach ($values as $k => $value) {
                 $res->{$k} = $value;
             }
         } else {
             $res = pg_fetch_object($this->_idResult);
         }
     }
     if ($res && count($this->modifier)) {
         foreach ($this->modifier as $m) {
             call_user_func_array($m, array($res, $this));
         }
     }
     return $res;
 }
开发者ID:CREASIG,项目名称:lizmap-web-client,代码行数:27,代码来源:pgsql.dbresultset.php

示例4: show_main_page

function show_main_page($dbconn, $diary_login)
{
    $sql = "SELECT u.uid, s.page_main, s.format_note FROM " . TABLE_SETTINGS . " AS s, " . TABLE_USERS . " AS u WHERE u.login='" . $diary_login . "' AND s.uid=u.uid LIMIT 1";
    $result = pg_query($dbconn, $sql) or die(pg_last_error($dbconn));
    $data = pg_fetch_object($result, NULL);
    echo assign_vars($data->page_main, array('{login}' => $diary_login, '{diary}' => get_last_notes($dbconn, $diary_login, $data->format_note), '{hrefguestbook}' => 'http://' . $_SERVER['SERVER_NAME'] . '/' . PAGE_GUESTBOOK, '{archive}' => get_archive($dbconn, $diary_login), '{links}' => get_links($dbconn, $diary_login)));
}
开发者ID:BackupTheBerlios,项目名称:diarusie-svn,代码行数:7,代码来源:index.inc.php

示例5: daemon_scanTime

function daemon_scanTime()
{
    require "daemon_db_init.php";
    // to initialize database connection
    // 1, get timestamp
    // $time = date("j F Y h:i:s A");
    // $timestamp = "'" . date('YmdGis') . "'";
    global $timestamp;
    // 2, check if the table "dameontimestamp" in the database "vanguardhe"
    $query_exist = "SELECT relname FROM pg_class \n\tWHERE relname = 'dameontimestamp';";
    $result_exist = pg_query($query_exist) or die('Query failed: ' . pg_last_error());
    $exist = '';
    while ($row_exist = pg_fetch_object($result_exist)) {
        $exist = $row_exist->relname;
    }
    // // 3, if not existed, create it
    if ($exist != "dameontimestamp") {
        # code...
        $query_construct = "CREATE TABLE PUBLIC.dameontimestamp(\n\t\t\tscanid SERIAL PRIMARY KEY,\n\t\t\ttime           TEXT,\n\t\t\talarmcount           TEXT );";
        $result_construct = pg_query($query_construct) or die('Query failed: ' . pg_last_error());
        pg_free_result($result_construct);
    }
    // 4, insert data into the table
    $query_insert = "INSERT INTO PUBLIC.dameontimestamp (time) VALUES ({$timestamp});";
    $result_insert = pg_query($query_insert) or die('Query failed: ' . pg_last_error());
    pg_free_result($result_exist);
    pg_free_result($result_insert);
}
开发者ID:7icken,项目名称:Network_Management_System,代码行数:28,代码来源:daemon_scanTime.php

示例6: getSubskills

function getSubskills($json = TRUE)
{
    /**
     * Gets the list of available subskills
     * @author  Germán Sánchez (GREC-ESADE), Collage
     * @version march 2014
     */
    global $conn;
    $sql = 'SELECT * FROM ' . TABLE_SUBSKILLS . ' ORDER BY lower(text) ASC';
    $result = consulta($sql, $conn);
    $out = array();
    while ($obj = pg_fetch_object($result)) {
        $out[] = $obj;
    }
    if (FALSE) {
        # hand-build
        $out = array();
        $out[] = array('id' => 1, 'text' => 'quick response');
        $out[] = array('id' => 2, 'text' => 'prolific');
        $out[] = array('id' => 3, 'text' => 'extensive');
    }
    if ($json) {
        $out = json_encode($out);
    }
    return $out;
}
开发者ID:Peaso,项目名称:CER,代码行数:26,代码来源:er_functions.php

示例7: show_guestbook_add_page

function show_guestbook_add_page($dbconn, $diary_login)
{
    $sql = "SELECT u.uid, s.page_guestbook_add FROM " . TABLE_USERS . " AS u, " . TABLE_SETTINGS . " AS s WHERE s.uid=u.uid AND u.login='" . $diary_login . "' LIMIT 1";
    $result = pg_query($sql) or die(pg_last_error($dbconn));
    $data = pg_fetch_object($result, NULL);
    echo assign_vars($data->page_guestbook_add, array('{login}' => $diary_login, '{hrefguestbook}' => 'http://' . $_SERVER['SERVER_NAME'] . '/' . PAGE_GUESTBOOK));
}
开发者ID:BackupTheBerlios,项目名称:diarusie-svn,代码行数:7,代码来源:guestbook.inc.php

示例8: vencimento

function vencimento($dv, $cli_id, $ano_mes, $parcela, $id_servidor)
{
    $dados = @Comando::Executar("Select * from  evento_calc_mes\r\n    where cli_id = {$cli_id}\r\n \t\t\tand ano_mes = '{$ano_mes}'\r\n \t\t\tand parcela = '{$parcela}'\r\n\t\t\tand id_servidor = {$id_servidor}\r\n\t\t\tand tipo_evento ='{$dv}'\r\n \t");
    $lista_dados = "";
    while ($objx = @pg_fetch_object($dados)) {
        if ($objx->tipo_evento == 'V') {
            //&& (strcmp($dv,"V"))){
            $valor = valorM($objx->valor);
            $lista_dados .= "<tr>\r\n              <td class='codigo border centerText vertTop'>\r\n                {$objx->cod_evento}\r\n              </td>\r\n              <td class='descricao border vertTop'>\r\n                {$objx->descricao}\r\n              </td>\r\n              <td class='quantidade border rightText vertTop'>\r\n                {$objx->ref_qtd}\r\n              </td>\r\n              <td class='valor border rightText vertTop'>\r\n                {$valor}\r\n              </td>\r\n            </tr>";
            // $lista_dados.=	"
            // 	<div class='leftx' style='width:8%'>$objx->cod_evento</div>
            // 	<div class='leftx' style='width:58%'>$objx->descricao</div>
            //    	<div class='leftx' style='width:14%'>$objx->ref_qtd</div>
            //    	<div class='leftx' style='width:20%' align='right'>".valorM($objx->valor)."</div>
            // ";
        } else {
            $valor = valorM($objx->valor);
            //if($objx->tipo_evento=='D'){// && (strcmp($dv,"D")) ){
            $lista_dados .= "<tr>\r\n        <td class='codigo border centerText vertTop'>\r\n        {$objx->cod_evento}\r\n        </td>\r\n        <td class='descricao border vertTop'>\r\n        {$objx->descricao}\r\n        </td>\r\n        <td class='quantidade border rightText vertTop'>\r\n        {$objx->ref_qtd}\r\n        </td>\r\n        <td class='valor border rightText vertTop'>\r\n        {$valor}\r\n        </td>\r\n        </tr>";
            // 			$lista_dados.= "
            //   <div class='leftx' style='width:8%'>$objx->cod_evento</div>
            //   <div class='leftx' style='width:58%'>$objx->descricao &nbsp; $objx->observacao</div>
            //   <div class='leftx' style='width:14%'>$objx->ref_qtd</div>
            //   <div class='leftx' style='width:20%' align='right'>".valorM($objx->valor)."</div>
            // ";
        }
    }
    return $lista_dados;
    /*
    <div class="leftx" style="width:8%">1</div>
     <div class="leftx" style="width:58%">2fgfgn</div>
         <div class="leftx" style="width:14%">3</div>
         <div class="leftx" style="width:20%">4</div>
    */
}
开发者ID:hsnunes,项目名称:rhtransparencia,代码行数:35,代码来源:relatoriohtml__.php

示例9: fetch_object

function fetch_object($r)
{
    if ($pgsql) {
        return pg_fetch_object($r);
    } else {
        return mysql_fetch_object($r);
    }
}
开发者ID:cabloo,项目名称:RTG2,代码行数:8,代码来源:targetmaker.php

示例10: result

/**
 * returns the results as an object.
 *
 * Used like: while($row = result($information)){ print($row->name); }
 */
function result($stuff)
{
    if (server_type == "mysql") {
        return mysql_fetch_object($stuff);
    } elseif (server_type == "postgresql") {
        return pg_fetch_object($stuff);
    }
}
开发者ID:kfr2,项目名称:phpmygrades,代码行数:13,代码来源:sqllib.php

示例11: fetch

 public function fetch($res)
 {
     $result = array();
     while ($data = pg_fetch_object($res)) {
         $result[] = $data;
     }
     return $result;
 }
开发者ID:hendisantika,项目名称:ajax-crud-bootstrap,代码行数:8,代码来源:pgsql.php

示例12: show_comment_add_page

function show_comment_add_page($dbconn, $diary_login)
{
    $nid = (int) $_GET['nid'];
    $sql = "SELECT u.uid, s.page_comment_add FROM " . TABLE_USERS . " AS u, " . TABLE_SETTINGS . " AS s WHERE s.uid=u.uid AND u.login='" . $diary_login . "' LIMIT 1";
    $result = pg_query($sql) or die(pg_last_error($dbconn));
    $data = pg_fetch_object($result, NULL);
    echo assign_vars($data->page_comment_add, array('{login}' => $diary_login, '{hrefcomment}' => 'http://' . $_SERVER['SERVER_NAME'] . '/' . PAGE_COMMENTS . '&nid=' . $nid, '{nid}' => $nid));
}
开发者ID:BackupTheBerlios,项目名称:diarusie-svn,代码行数:8,代码来源:comments.inc.php

示例13: show_error_page

function show_error_page($dbconn, $diary_login, $message)
{
    $sql = "SELECT u.uid, s.page_error FROM " . TABLE_SETTINGS . " AS s, " . TABLE_USERS . " AS u WHERE u.login='" . $diary_login . "' AND s.uid=u.uid LIMIT 1";
    $result = pg_query($sql) or die(pg_last_error($dbconn));
    $data = pg_fetch_object($result, NULL);
    pg_free_result($result);
    echo assign_vars($data->page_error, array('{login}' => $diary_login, '{errormessage}' => $message));
}
开发者ID:BackupTheBerlios,项目名称:diarusie-svn,代码行数:8,代码来源:error.inc.php

示例14: next

 public function next($object = false)
 {
     if ($object) {
         $this->current = pg_fetch_object($this->res);
     } else {
         $this->current = pg_fetch_assoc($this->res);
     }
     return $this->current;
 }
开发者ID:webcraftmedia,项目名称:system,代码行数:9,代码来源:ResultPostgres.php

示例15: next

 public function next($object = false, $result_type = MYSQL_BOTH)
 {
     if ($object) {
         $this->current = pg_fetch_object($this->res);
     } else {
         $this->current = pg_fetch_assoc($this->res);
     }
     return $this->current;
 }
开发者ID:webcraftmedia,项目名称:system,代码行数:9,代码来源:ResultAMQP.php


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