pg_fetch_array and composite fields
| From: | Rodrigo Dias | Date: | Mon, 10 Jan 2011 13:23:30 +0000 |
| Subject: | pg_fetch_array and composite fields | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-47620@lists.php.net to get a copy of this message | ||
Hello all!
I'm trying to print only one value from a composite field:
while ($row = pg_fetch_array($result,NULL,PGSQL_ASSOC)) {
if (isset($row["indef_tam"])) {
echo "Sizes: ".$row["indef_tam"]; // this shows me the three
values from the composite field as a string (e.g. '(100,50,150)' )
echo "Medium size: ".$row["(indef_tam).med"]; // this should show
me the first value, but it doesn't work!
}
}
I can parse the result of the first option through the commas, but
there should be a simpler way. Can anyone help me, please?