|
|
|
//Put this code in an include file, require it, and call
//ShowResults($result) whenever you need to see what your
//queries result in.
<?php
Function ShowResults($result) {
if ($result) {
$rows = pg_NumRows($result);
$cols = pg_NumFields($result);
echo("<table border=1>\n");
/* Create the headers */
echo("<tr>\n");
for($i = 0; $i < $cols; $i++) {
printf("<th>%s</th>\n", pg_FieldName($result, $i));
}
echo("</tr>");
for($j = 0; $j < $rows; $j++) {
echo("<tr>\n");
for($i = 0; $i < $cols; $i++) {
printf("<td>%s</td>\n", pg_result($result, $j, $i));
}
echo("</tr>");
}
echo("</table>");
} else {
echo(pg_errormessage);
}
}
?> |
|
| PostGreSQL and MySQL 2 in 1 db Manager Categories : PHP, PHP Classes, Databases, PostgreSQL, MySQL | | | Script for postgresql to walk through the results limiting the results shown per
page. Categories : PostgreSQL, Databases, PHP | | | Monthly and Daily Upcoming Events calendar. Categories : Date Time, PostgreSQL, PHP, Calendar, Databases | | | AUTH (.htaccess style) - a login system that uses PostgreSQL. Categories : PHP, Authentication, Databases, PostgreSQL | | | DBE - Database Expander: Edit PostgreSQL individual database tables online via your Web browser! Categories : PostgreSQL, Complete Programs, Databases, PHP Classes, PHP | | | TABLE LIST, DATABASE LIST, PHP , PostgreSQL, ADMIN, Web Interface,
database admin Categories : PHP, PostgreSQL | | | Using Postgres and PHP3 Authentication from a Web application Categories : PostgreSQL, HTML and PHP, Authentication, PHP | | | pg_client_encoding -- Get the client encoding Categories : PHP, PHP Functions, PostgreSQL | | | Save and restore files into postgresql database (PHP SCRIPT) PHP CLASS Categories : PHP, Databases, PostgreSQL, Filesystem | | | Is there any way to test that the $result has null values or not without reading the field values in the results in postgre?
Categories : PostgreSQL, PHP, Databases | | | Query2Report : Generating Html, Pdf and Csv Reports from SQL Query Categories : PHP, PHP, HTML, PDF, Excel | | | Postgresql Database Backup And Restore PHP script Categories : PHP, Databases, PostgreSQL | | | This is a database wrapper for PostgreSQL, but can be simply modified for any other database type. Categories : Databases, PostgreSQL, PHP | | | A small message board using PostgreSQL Categories : PostgreSQL, General, PHP | | | This is a function to display a table for Postgres results. This this code in an include file, require it, and call ShowResults($result) whenever you need to see what your queries result in. Categories : Databases, PHP, PostgreSQL | |
|
|
|