Re: DB Associative Arrays

From: Date: Tue, 29 Jun 2004 07:34:48 +0000
Subject: Re: DB Associative Arrays
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-13397@lists.php.net to get a copy of this message
Don Fitzsimmons wrote:
I'm using the following parameters in a DB query: $this->result = $this->db->getAssoc($query,
        false, array(), DB_FETCHMODE_ASSOC);
This makes a beautiful assoc array, but it uses my first database field as the index, so my user_id in this case becomes the index and I can't use the index anywhere else because its not a field anymore but an index. Is there a way around this? Here's my array printed out with the missing user_id (it has become the index). Array ( [1] => Array ( [name] => Paul De La Cruz [email] => email@address.net [main_phone] => 407-351-2972 [program] => Master of Eletrical and Computer Engineering [created_date] => 2004-06-20 00:00:00 [student_type] => Online Education [student_type_id] => 1 ) ) Don
use: $this->result = $this->db->getAll($query,null,null,DB_FETCHMODE_ASSOC); ____________________________________________________________ This message may contain legally privileged or confidential information and is therefore addressed to the named persons only. The recipient should inform the sender and delete this message, if he/she is not named as addressee. The sender disclaims any and all liability for the integrity and punctuality of this message. The sender has activated an automatic virus scanning by Messagelabs, but does not guarantee the virus free transmission of this message.

« previous php.pear.general (#13397) next »