For Programmers: Free Programming Magazines  


Home > Archive > PHP Pear > June 2004 > DB Associative Arrays









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author DB Associative Arrays
Don Fitzsimmons

2004-06-29, 3:56 am

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
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com