note 44864 deleted from function.pg-fetch-array by aidan
| From: | aidan@php.net | Date: | Thu, 19 Aug 2004 10:04:37 +0000 |
| Subject: | note 44864 deleted from function.pg-fetch-array by aidan | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-74930@lists.php.net to get a copy of this message | ||
Note Submitter: lemiresteve at hotmail dot com
----
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);
}