note 42141 deleted from function.pg-result-status by tomsommer
| From: | tomsommer@php.net | Date: | Wed, 05 May 2004 15:23:14 +0000 |
| Subject: | note 42141 deleted from function.pg-result-status by tomsommer | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-69242@lists.php.net to get a copy of this message | ||
Note Submitter: Raelian DOTCOM (raelian_at_raelian.com)
----
Usefull function to check if a table exist, rather than select something and check error code.
If you create a table by a program this might needed.
function IsTableExist($table)
{
$res = pg_query("select * from PG_TABLES where TableName = '$table'");
if (pg_num_rows($res) > 0) return true;
return false;
}
* Note
I'm using PostgreSQL v7.1, you should check if table name (PG_TABLES) or field name (TableName)
are same in other version of PostgreSQL.