DB->getAssoc: Question
| From: | Massimiliano Bariola | Date: | Mon, 05 Sep 2005 10:05:24 +0000 |
| Subject: | DB->getAssoc: Question | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-20790@lists.php.net to get a copy of this message | ||
hi,
I am trying to achieve this:
SELECT IDAnag, Chips.* FROM Chips WHERE blah blah
trying to have an array whose items are like this:
[IDAnagValue] => array('IDAnag' => IDAnagValue, 'Field1' =>Field1Value,
blah blah)
But it seems that, as IDAnag is used as a key, it gets removed from the
array of values, i.e. my array above starts with Field1.
I have been reading the docs, but couldn't find a way to avoid this
removal, so only solution I found is to foreach() my array and re-add the
'IDAnag' => IDAnagValue field into the array of values.
Did I miss something? any cleaner way to do it?
thanks in advance.
--
Massimiliano Bariola
m.bariola@prodigiweb.it