|
|
|
| Title : |
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 |
 Nathan Straz |
| Date : |
Jan 17th 1999 |
| Grade : |
1 of 5 (graded 2 times) |
| Viewed : |
5332 |
| File : |
No file for this code example. |
| Images : |
No Images for this code example. |
|
| Search : |
More code by Nathan Straz |
|
| Action : |
Grade This Code Example
|
|
| Tools : |
My Examples List |
|
|
|
|
|
|
<?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);
}
}
?> |
|
| This is Yet Another Sql Abstraction Library. Include it in your script and you can use the most important SQL functions without worrying about the SQL backend. Categories : Databases, PHP, ODBC, MySQL, PostgreSQL | | | PostGreSQL and MySQL 2 in 1 db Manager Categories : PHP, PHP Classes, Databases, PostgreSQL, MySQL | | | Monthly and Daily Upcoming Events calendar. Categories : Date Time, PostgreSQL, PHP, Calendar, Databases | | | Script for postgresql to walk through the results limiting the results shown per
page. Categories : PostgreSQL, Databases, PHP | | | AUTH (.htaccess style) - a login system that uses PostgreSQL. Categories : PHP, Authentication, Databases, PostgreSQL | | | Logs hits to any page which includes it. Automatically utilises page access information left behind by PHP/FI2.0. Categories : Databases, PHP, mSQL, Databases | | | DBE - Database Expander: Edit PostgreSQL individual database tables online via your Web browser! Categories : PostgreSQL, Complete Programs, Databases, PHP Classes, PHP | | | PSQLAdmin ver 1.00 uses PHP and PostgreSQL to create, modify, and delete tables and records.
Categories : Databases, PHP, 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 | | | This program allows you to upload an ODBC ressource - i.e. an MS-Access database to a MySQL server. Categories : Databases, MySQL, Complete Programs, PHP, Databases | | | 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 | | | PhpIBadmin - Web interface to Interbase RBDMS , this is a port of
phpMyadmin Categories : Databases, InterBase, PHP | | | simple script to send emails via a html-form to different users Categories : Email, MySQL, PHP, Databases | |
|
|
|