note 42141 added to function.pg-result-status

From: Date: Wed, 05 May 2004 04:18:12 +0000
Subject: note 42141 added to function.pg-result-status
Groups: php.notes 
Request: Send a blank email to php-notes+get-69220@lists.php.net to get a copy of this message
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. ---- Manual Page -- http://www.php.net/manual/en/function.pg-result-status.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+42141 Delete -- http://master.php.net/manage/user-notes.php?action=delete+42141&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+42141&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#69220) next »