note 47818 added to function.pg-query

From: Date: Wed, 01 Dec 2004 16:07:46 +0000
Subject: note 47818 added to function.pg-query
Groups: php.notes 
Request: Send a blank email to php-notes+get-81226@lists.php.net to get a copy of this message
Use pg_query to call your stored procedures, and use pg_fetch_result when getting a value (like a smallint as in this example) returned by your stored procedure. <?php $pgConnection = pg_connect("dbname=users user=me"); $userNameToCheckFor = "metal"; $result = pg_query($pgConnection, "SELECT howManyUsersHaveThisName('$userNameToCheckFor')"); $count = pg_fetch_result($result, 0, 'howManyUsersHaveThisName'); ?> ---- Manual Page -- http://www.php.net/manual/en/function.pg-query.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+47818 Delete -- http://master.php.net/manage/user-notes.php?action=delete+47818&report=yes Reason: bad code -- http://master.php.net/manage/user-notes.php?action=delete+47818&report=yes&reason=bad+code Reason: spam -- http://master.php.net/manage/user-notes.php?action=delete+47818&report=yes&reason=spam Reason: useless example -- http://master.php.net/manage/user-notes.php?action=delete+47818&report=yes&reason=useless+example Reason: contains commercial links -- http://master.php.net/manage/user-notes.php?action=delete+47818&report=yes&reason=contains+commercial+links Reason: useless note -- http://master.php.net/manage/user-notes.php?action=delete+47818&report=yes&reason=useless+note Reject -- http://master.php.net/manage/user-notes.php?action=reject+47818&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#81226) next »