note 56506 added to function.pg-query
| From: | cmoore at osu1 dot php dot net | Date: | Mon, 05 Sep 2005 18:20:52 +0000 |
| Subject: | note 56506 added to function.pg-query | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-94761@lists.php.net to get a copy of this message | ||
One thing to note that wasn't obvious to me at first. If your query returns zero rows, that is
not a "failed" query. So the following is wrong:
$result=pg_query($conn, "SELECT * FROM x WHERE a=b;");
if (!$result) {
echo "No a=b in x\n";
}
pg_query returns FALSE if the query can not be executed for some reason. If the query is executed
but returns zero rows then you get back a resul with no rows.
----
Manual Page -- http://www.php.net/manual/en/function.pg-query.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+56506
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+56506&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+56506&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+56506&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+56506&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+56506&report=yes&reason=non-english
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+56506&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+56506&report=yes
Search -- http://master.php.net/manage/user-notes.php