RE: [PHP] adding values to array from query
| From: | Don Read | Date: | Mon, 07 Apr 2003 10:50:32 +0000 |
| Subject: | RE: [PHP] adding values to array from query | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-142678@lists.php.net to get a copy of this message | ||
On 07-Apr-2003 Charles Kline wrote:
> hi all,
>
> if have a query like so (using pear db):
>
> $result = $db->getAll($sql);
> if (DB::iserror($result)){
> die($result->getDebugInfo() . " at line " . __line__);
> }
>
> How would I go about pushing a value to the front (position 0) of that
> array?
>
> I have a value $attributes['id'] that I want to stick on the front of
> $result.
>
array_unshift();
Regards,
--
Don Read dread@texas.net
-- It's always darkest before the dawn. So if you are going to
steal the neighbor's newspaper, that's the time to do it.