note 44864 added to function.pg-fetch-array
| From: | lemiresteve at hotmail dot com | Date: | Wed, 18 Aug 2004 14:05:42 +0000 |
| Subject: | note 44864 added to function.pg-fetch-array | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-74882@lists.php.net to get a copy of this message | ||
Like gherson at snet dot net said, PGSQL_BOTH is the default, meaning your array size will be
DOUBLED, and i know you don't want that....There is a little function that take any kind of
parameters (index or string name for field) and return it's value.
/************************************************************
Return the fields value
Field can be an integer or a string name representing the column
************************************************************/
function GetFieldValue($Result, $lRowNumber, $FieldIndex){
if (is_numeric($FieldIndex)){
$tblValue = pg_fetch_array($Result, $lRowNumber, PGSQL_NUM);
} else {
$tblValue = pg_fetch_array($Result, $lRowNumber, PGSQL_ASSOC);
}
$vReturn = $tblValue[$FieldIndex];
return htmlentities($vReturn, ENT_QUOTES);
}
----
Manual Page -- http://www.php.net/manual/en/function.pg-fetch-array.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+44864
Delete -- http://master.php.net/manage/user-notes.php?action=delete+44864&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+44864&report=yes
Search -- http://master.php.net/manage/user-notes.php