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


PHP pg_result函数代码示例

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


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


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