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

PHP pg_result函数代码示例

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

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



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

示例1: generarPDF

 public function generarPDF()
 {
     $sql = "SELECT codigo,nombre,apellido,cedula,edad,semestre from estudiante";
     $resultado = $this->objCon->Ejecutar($sql);
     if ($resultado && pg_numrows($resultado) > 0) {
         require_once '../Recursos/html2pdf/html2pdf.class.php';
         // Se carga la libreria
         ob_start();
         //Habilita el buffer para la salida de datos
         ob_get_clean();
         //Limpia lo que actualmente tenga el buffer
         //En la variable content entre las etiquetas <page></page> va todo el contenido del pdf en formato html
         $content = "<page>";
         $content .= "<h1>ESTE ES EL REPORTE</h1>";
         $content .= '<link href="../Recursos/css/estilosPDF.css" type="text/css" rel="stylesheet">';
         $content .= "<table border='1'>";
         $content .= "<tr>";
         $content .= "<th>Codigo</th>";
         $content .= "<th>Nombre</th>";
         $content .= "<th>Apellido</th>";
         $content .= "<th>Cedula</th>";
         $content .= "<th>Edad</th>";
         $content .= "<th>Semestre</th>";
         $content .= "</tr>";
         for ($cont = 0; $cont < pg_numrows($resultado); $cont++) {
             $content .= "<tr>";
             $content .= "<td>" . pg_result($resultado, $cont, 0) . "</td>";
             $content .= "<td>" . pg_result($resultado, $cont, 1) . "</td>";
             $content .= "<td>" . pg_result($resultado, $cont, 2) . "</td>";
             $content .= "<td>" . pg_result($resultado, $cont, 3) . "</td>";
             $content .= "<td>" . pg_result($resultado, $cont, 4) . "</td>";
             $content .= "<td>" . pg_result($resultado, $cont, 5) . "</td>";
             $content .= "</tr>";
         }
         $content .= "</table>";
         $content .= "</page>";
     } else {
         $content = "<b>No hay registros en la base de datos</b>";
     }
     $html2pdf = new HTML2PDF('P', 'A4', 'es');
     //formato del pdf (posicion (P=vertical L=horizontal), tamaño del pdf, lenguaje)
     $html2pdf->WriteHTML($content);
     //Lo que tenga content lo pasa a pdf
     ob_end_clean();
     // se limpia nuevamente el buffer
     $html2pdf->Output('exemple.pdf');
     //se genera el pdf, generando por defecto el nombre indicado para guardar
 }
开发者ID:johnny9052,项目名称:EjemploJQUERYMobileCRUD,代码行数:48,代码来源:estudianteDAO.php


示例2: construirListado

 function construirListado($resultado)
 {
     if ($resultado && pg_num_rows($resultado) > 0) {
         $cadenaHTML = "<table border ='1'>";
         $cadenaHTML .= "<tr>";
         $cadenaHTML .= "<th>Codigo</th>";
         $cadenaHTML .= "<th>Nombre</th>";
         $cadenaHTML .= "<th>Apellido</th>";
         $cadenaHTML .= "<th>Cedula</th>";
         $cadenaHTML .= "<th>Edad</th>";
         $cadenaHTML .= "<th>Semestre</th>";
         $cadenaHTML .= "</tr>";
         for ($cont = 0; $cont < pg_numrows($resultado); $cont++) {
             $cadenaHTML .= "<tr>";
             $cadenaHTML .= "<td>" . pg_result($resultado, $cont, 0) . "</td>";
             $cadenaHTML .= "<td>" . pg_result($resultado, $cont, 1) . "</td>";
             $cadenaHTML .= "<td>" . pg_result($resultado, $cont, 2) . "</td>";
             $cadenaHTML .= "<td>" . pg_result($resultado, $cont, 3) . "</td>";
             $cadenaHTML .= "<td>" . pg_result($resultado, $cont, 4) . "</td>";
             $cadenaHTML .= "<td>" . pg_result($resultado, $cont, 5) . "</td>";
             $cadenaHTML .= "</tr>";
         }
         $cadenaHTML .= "</table>";
     } else {
         $cadenaHTML = "<b>No hay Registros en la Base de datos</b>";
     }
     header('location:../index.php?page=estudiantes&&info_list=' . $cadenaHTML);
 }
开发者ID:johnny9052,项目名称:DAOLoginMasterPage,代码行数:28,代码来源:estudianteDAO.php


示例3: listadoRegistro

 function listadoRegistro($resultado)
 {
     if ($resultado && pg_numrows($resultado) > 0) {
         $cadenaHTML = "<table border='1'>";
         $cadenaHTML .= "<tr>";
         $cadenaHTML .= "<th>Codigo</th>";
         $cadenaHTML .= "<th>Nombre</th>";
         $cadenaHTML .= "<th>Apellido</th>";
         $cadenaHTML .= "<th>Cedula</th>";
         $cadenaHTML .= "<th>Edad</th>";
         $cadenaHTML .= "<th>Semestre</th>";
         $cadenaHTML .= "</tr>";
         for ($cont = 0; $cont < pg_numrows($resultado); $cont++) {
             $cadenaHTML .= "<tr>";
             $cadenaHTML .= "<td>" . pg_result($resultado, $cont, 0) . "</td>";
             $cadenaHTML .= "<td>" . pg_result($resultado, $cont, 1) . "</td>";
             $cadenaHTML .= "<td>" . pg_result($resultado, $cont, 2) . "</td>";
             $cadenaHTML .= "<td>" . pg_result($resultado, $cont, 3) . "</td>";
             $cadenaHTML .= "<td>" . pg_result($resultado, $cont, 4) . "</td>";
             $cadenaHTML .= "<td>" . pg_result($resultado, $cont, 5) . "</td>";
             $cadenaHTML .= "</tr>";
         }
         $cadenaHTML .= "</table>";
     } else {
         $cadenaHTML = "<b>No hay registros en la base de datos</b>";
     }
     header('location:../Index.php?tabla=' . $cadenaHTML);
 }
开发者ID:johnny9052,项目名称:CRUD_PHP_Registro_Academico,代码行数:28,代码来源:clsConexion.php


示例4: pg_fetch_all

function pg_fetch_all($result)
{
    $o = array();
    for ($i = 0; $i = pg_numrows($result); $i++) {
        $o[$i] = pg_result($result, $i);
    }
    return $o;
}
开发者ID:nbtscommunity,项目名称:phpfnlib,代码行数:8,代码来源:db.php


示例5: create_station

function create_station($stationname)
{
    $sql = "INSERT INTO Stations (name) VALUES('{$stationname}')";
    pg_query($sql);
    $sql = "SELECT id from Stations ORDER by id desc limit 1";
    $res = pg_query($sql);
    return pg_result($res, 0, 0);
}
开发者ID:vrodic,项目名称:Vlakic,代码行数:8,代码来源:hzparse.php


示例6: command_result

/**
 * used if you need to run a SQL command, like MAX()
 * \todo figure out some way around using this
 */
function command_result($stuff, $number)
{
    if (server_type == "mysql") {
        return mysql_result($stuff, $number);
    } elseif (server_type == "postgresql") {
        return pg_result($stuff, $number);
    }
}
开发者ID:kfr2,项目名称:phpmygrades,代码行数:12,代码来源:sqllib.php


示例7: Header

 function Header()
 {
     global $conn;
     global $result;
     global $url;
     //Dados da instituição
     $dados = @pg_exec("select nomeinst,ender,munic,uf,telef,email,url,logo from db_config where codigo = " . @$GLOBALS["DB_instit"]);
     $url = @pg_result($dados, 0, "url");
     $this->SetXY(1, 1);
     $this->Image('../imagens/files/' . pg_result($dados, 0, "logo"), 7, 3, 20);
     //$this->Cell(100,32,"",1);
     $nome = pg_result($dados, 0, "nomeinst");
     global $nomeinst;
     $nomeinst = pg_result($dados, 0, "nomeinst");
     if (strlen($nome) > 42) {
         $TamFonteNome = 8;
     } else {
         $TamFonteNome = 9;
     }
     $this->SetFont('Arial', 'BI', $TamFonteNome);
     $this->Text(33, 9, $nome);
     $this->SetFont('Arial', 'I', 8);
     $this->Text(33, 14, trim(pg_result($dados, 0, "ender")));
     $this->Text(33, 18, trim(pg_result($dados, 0, "munic")) . " - " . pg_result($dados, 0, "uf"));
     $this->Text(33, 22, trim(pg_result($dados, 0, "telef")));
     $this->Text(33, 26, trim(pg_result($dados, 0, "email")));
     $this->Text(33, 30, $url);
     //parametros
     //	$this->SetXY(108,3);
     //	$this->SetFillColor(235);
     //	$this->Cell(98,29,"",1,0,0,1);
     //    $this->Line(178,3,178,32);
     //    $this->Line(178,13,206,13);
     //    $this->Line(178,22,206,22);
     //    $this->Text(180,10,date("d-m-Y"));
     //    $this->Text(180,20,date("H:i:s"));
     //    $this->Text(180,30,@$GLOBALS["DB_login"]);
     //    $this->SetFont('Arial','',6);
     //    $this->Text(179,5,"Data:");
     //    $this->Text(179,15,"Hora:");
     //    $this->Text(179,24,"Login:");
     $Espaco = $this->w - 70;
     $this->SetFont('Arial', '', 8);
     //	$this->Text(140,6,@$GLOBALS["head1"]);
     $this->Text($Espaco, 6, @$GLOBALS["head1"]);
     $this->Text($Espaco, 9, @$GLOBALS["head2"]);
     $this->Text($Espaco, 12, @$GLOBALS["head3"]);
     $this->Text($Espaco, 15, @$GLOBALS["head4"]);
     $this->Text($Espaco, 18, @$GLOBALS["head5"]);
     $this->Text($Espaco, 21, @$GLOBALS["head6"]);
     $this->Text($Espaco, 24, @$GLOBALS["head7"]);
     $this->Text($Espaco, 27, @$GLOBALS["head8"]);
     $this->Text($Espaco, 30, @$GLOBALS["head9"]);
     //$this->Ln(25);
     $this->SetY(35);
 }
开发者ID:arendasistemasintegrados,项目名称:mateusleme,代码行数:56,代码来源:pdfger.php


示例8: enviarpass

function enviarpass($correo)
{
    if (!empty($correo)) {
        $resultado = ejecutaConsulta("Select password,idioma from usuario where correo='{$correo}';");
        $pass = pg_result($resultado, 0, 'password') or sysError("activa.php.No tiene pass");
        mandarCorreoPass($correo, $pass);
        return 'true';
    } else {
        return 'false';
    }
}
开发者ID:snake77se,项目名称:cergvsigtraining,代码行数:11,代码来源:correo.php


示例9: calcula_valores

 function calcula_valores()
 {
     $this->sqlporreceita = "\n\t               select k00_numpre,k00_numpar,k00_receit,k00_dtvenc,k00_dtoper,sum(k00_valor) as k00_valor \n\t               from arrecad \n\t\t\t\t   where k00_numpre = {$this->np} and ( ";
     $or = "";
     echo pg_numrows($this->resultparcelas);
     for ($i = 0; $i < $this->resultparcelas; $i++) {
         $this->sqlporreceita .= $or . " k00_numpar = " . pg_result($this->resultparcelas, $i, "k00_numpar");
         $or = " or ";
     }
     $this->sqlporreceita .= ") group by k00_numpre,k00_numpar,k00_receit,k00_dtvenc,k00_dtoper";
     return true;
 }
开发者ID:arendasistemasintegrados,项目名称:mateusleme,代码行数:12,代码来源:db_carne.php


示例10: db_mensagem

function db_mensagem($cabecalho, $rodape)
{
    global $DB_mens1, $DB_align1, $DB_mens2, $DB_align2;
    $result = pg_query("select mens,alinhamento from db_confmensagem where (cod = '{$cabecalho}' or cod = '{$rodape}') and instit = " . db_getsession("DB_instit") . " order by cod");
    if (pg_numrows($result) == 0) {
        db_msgbox2("Mensagem não encontrado para: {$cabecalho} {$rodape}");
        //redireciona("index.php");
        exit;
    }
    $DB_mens1 = @pg_result($result, 0, 0);
    $DB_align1 = @pg_result($result, 0, 1);
    $DB_mens2 = @pg_result($result, 1, 0);
    $DB_align2 = @pg_result($result, 1, 1);
}
开发者ID:arendasistemasintegrados,项目名称:mateusleme,代码行数:14,代码来源:db_sql.php


示例11: justdump

function justdump($tablename)
{
    $res2 = pg_query("SELECT  * FROM {$tablename} ");
    $num2 = pg_numrows($res2);
    $num2f = pg_numfields($res2);
    for ($j = 0; $j < $num2; $j++) {
        $insvals = "";
        for ($z = 0; $z < $num2f; $z++) {
            $insvals .= "'" . pg_result($res2, $j, $z) . "',";
        }
        $insvals = substr($insvals, 0, -1);
        $sql = "INSERT INTO {$tablename} VALUES ({$insvals});";
        echo $sql . "\n";
    }
}
开发者ID:vrodic,项目名称:Vlakic,代码行数:15,代码来源:tosqlite.php


示例12: Count

 function Count()
 {
     $_count_command = "SELECT COUNT(*) FROM (" . $this->SelectCommand . ") AS _TMP {where}";
     $_where = "";
     $_filters = $this->Filters;
     for ($i = 0; $i < sizeof($_filters); $i++) {
         $_where .= " and " . $this->GetFilterExpression($_filters[$i]);
     }
     if ($_where != "") {
         $_where = "WHERE " . substr($_where, 5);
     }
     $_count_command = str_replace("{where}", $_where, $_count_command);
     $_result = pg_query($this->_Link, $_count_command);
     return pg_result($_result, 0, 0);
 }
开发者ID:skydel,项目名称:universal-online-exam,代码行数:15,代码来源:PostgreSLDataSource.php


示例13: construirOptionsSelect

 public function construirOptionsSelect($resultado, $page)
 {
     $cadenaHTML = "";
     if ($resultado && pg_num_rows($resultado) > 0) {
         for ($cont = 0; $cont < pg_num_rows($resultado); $cont++) {
             $variable = $cont == 0 ? "selected='selected'" : "";
             $cadenaHTML .= "<option " . $variable . " value='" . pg_result($resultado, $cont, 0) . "'>";
             $cadenaHTML .= pg_result($resultado, $cont, 1);
             $cadenaHTML .= "</option>";
         }
     } else {
         $cadenaHTML .= "<b>No hay registros en la base de datos</b>";
     }
     header('location: ../index.php?page=' . $page . '&&contenidoSel=' . $cadenaHTML);
 }
开发者ID:johnny9052,项目名称:loguinMasterPagePhpRegistroAjaxDAOPDF,代码行数:15,代码来源:generalDAO.php


示例14: spittable

function spittable($query)
{
    $res = pg_query($query);
    $num = pg_num_rows($res);
    $cols = pg_num_fields($res);
    for ($i = 0; $i < $num; $i++) {
        $c = "";
        for ($j = 0; $j < $cols; $j++) {
            $c .= pg_result($res, $i, $j) . "|";
        }
        echo "{$c}\n";
    }
    echo "\n";
    exit;
}
开发者ID:vrodic,项目名称:Vlakic,代码行数:15,代码来源:ac.php


示例15: checkID

function checkID()
{
    $bool;
    $query = "SELECT * FROM student";
    $result = pg_query($query);
    for ($i = 0; $i < pg_num_rows($result); $i++) {
        if ($_POST["id"] == pg_result($result, $i, "id")) {
            $bool = false;
            break;
        } else {
            $bool = true;
        }
    }
    return $bool;
}
开发者ID:ThanhThan1992,项目名称:demo-php,代码行数:15,代码来源:insert.php


示例16: autoselect

function autoselect($var, $type, $lang)
{
    global $conn;
    $res2 = pg_exec($conn, "SELECT * FROM contents " . "WHERE id = {$var} AND type = '{$type}' AND language = '{$lang}'");
    if ($res2 && pg_numrows($res2) == 1) {
        $var = pg_result($res2, 0, "content");
    } else {
        $res2 = pg_exec($conn, "SELECT * FROM contents " . "WHERE id = {$var} AND type = '{$type}' LIMIT 1");
        if ($res2 && pg_numrows($res2) == 1) {
            $var = pg_result($res2, 0, "content");
        } else {
            $var = "Not available.";
        }
    }
    return $var;
}
开发者ID:BackupTheBerlios,项目名称:ghns-svn,代码行数:16,代码来源:main.php


示例17: db_getNomeSecretaria

function db_getNomeSecretaria()
{
    $nomeSecretaria = "SECRETARIA DA FAZENDA";
    $sqlparag = " select db02_texto ";
    $sqlparag .= "   from db_documento ";
    $sqlparag .= "        inner join db_docparag  on db03_docum   = db04_docum ";
    $sqlparag .= "        inner join db_tipodoc   on db08_codigo  = db03_tipodoc ";
    $sqlparag .= "        inner join db_paragrafo on db04_idparag = db02_idparag ";
    $sqlparag .= " where db03_tipodoc = 1017 ";
    $sqlparag .= "   and db03_instit = " . db_getsession("DB_instit") . " ";
    $sqlparag .= " order by db04_ordem ";
    $resparag = db_query($sqlparag);
    if (pg_numrows($resparag) > 0) {
        $nomeSecretaria = pg_result($resparag, 0, 'db02_texto');
    }
    return $nomeSecretaria;
}
开发者ID:arendasistemasintegrados,项目名称:mateusleme,代码行数:17,代码来源:db_libtributario.php


示例18: fieldsMemory

 function fieldsMemory($rs, $idx, $formata = false, $mostra = false, $lEncode = false)
 {
     $oFields = new _db_fields();
     $numFields = pg_num_fields($rs);
     $iTotalLinhas = pg_num_rows($rs);
     for ($i = 0; $i < $numFields; $i++) {
         $sValor = "";
         $sFieldName = @pg_field_name($rs, $i);
         $sFieldType = @pg_field_type($rs, $i);
         if ($iTotalLinhas > 0) {
             $sValor = trim(@pg_result($rs, $idx, $sFieldName));
         }
         if ($formata) {
             switch ($sFieldType) {
                 case "date":
                     if ($sValor != null) {
                         $sValor = implode('/', array_reverse(explode("-", $sValor)));
                     }
                     break;
                 default:
                     $sValor = stripslashes($sValor);
                     break;
             }
         }
         if ($mostra) {
             echo $sFieldName . " => " . $sValor . " <br>";
         }
         if ($lEncode) {
             switch ($sFieldType) {
                 case "bpchar":
                     $sValor = urlencode($sValor);
                     break;
                 case "varchar":
                     $sValor = urlencode($sValor);
                     break;
                 case "text":
                     $sValor = urlencode($sValor);
                     break;
             }
         }
         $oFields->{$sFieldName} = $sValor;
     }
     return $oFields;
 }
开发者ID:arendasistemasintegrados,项目名称:mateusleme,代码行数:44,代码来源:db_utils.php


示例19: wypisz_tabele

function wypisz_tabele($nazwa_tabeli)
{
    $zapytanie = "select * from {$nazwa_tabeli}";
    $wynik_zapytania = pg_exec(polacz(), $zapytanie);
    echo '<table border="1">';
    echo '<tr>';
    for ($i = 0; $i < pg_numfields($wynik_zapytania); $i++) {
        echo '<td>' . pg_field_name($wynik_zapytania, $i) . '</td>';
    }
    echo '</tr>';
    for ($i = 0; $i < pg_numrows($wynik_zapytania); $i++) {
        echo '<tr>';
        for ($j = 0; $j < pg_numfields($wynik_zapytania); $j++) {
            echo '<td>' . pg_result($wynik_zapytania, $i, $j) . '</td>';
        }
        echo '</tr>';
    }
    echo '</table>';
}
开发者ID:s179861,项目名称:vie_data_save,代码行数:19,代码来源:Z1.php


示例20: wypisz_tabele

function wypisz_tabele($wynik_zapytania, $naglowek)
{
    echo '<table border="1">';
    if ($naglowek == true) {
        echo '<tr>';
        for ($i = 0; $i < pg_numfields($wynik_zapytania); $i++) {
            echo '<td>' . pg_field_name($wynik_zapytania, $i) . '</td>';
        }
        echo '</tr>';
    }
    for ($i = 0; $i < pg_numrows($wynik_zapytania); $i++) {
        echo '<tr>';
        for ($j = 0; $j < pg_numfields($wynik_zapytania); $j++) {
            echo '<td>' . pg_result($wynik_zapytania, $i, $j) . '</td>';
        }
        echo '</tr>';
    }
    echo '</table>';
}
开发者ID:s179861,项目名称:vie_data_save,代码行数:19,代码来源:func_wypisz_tabele.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP pg_result_error函数代码示例发布时间:2022-05-15
下一篇:
PHP pg_query_params函数代码示例发布时间: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