RE: [PHP-WIN] Array Question

From: Date: Fri, 17 Aug 2007 16:59:53 +0000
Subject: RE: [PHP-WIN] Array Question
References: 1  Groups: php.windows 
Request: Send a blank email to php-windows+get-28376@lists.php.net to get a copy of this message
Just use a column alias in your sql query and reference the alias in your array. SELECT t1.contactID as 'contactID_1', t2.contactID AS 'contactID_2' FROM table1 t1, table2 t2 ...rest of query Then your results data array can be referenced like so: mydata['contactID_1'] mydata['contactID_2'] Ken Vandegrift Shari's Management Corporation Web Developer/Administrator kvandegrift@sharis.com -----Original Message----- From: Daniel Kaliel [mailto:Daniel.Kaliel@jjbedmonton.com] Sent: Friday, August 17, 2007 9:40 AM To: php-windows@lists.php.net Subject: [PHP-WIN] Array Question I have pull a bunch of data from an SQL database through a query. The problem I am running into is I pull two fields with the exact same name.. How do I grab the right info? I have been using mydata ß the array name. mydata['contactID'] Should I instead use the array value so mydata[8]?

« previous php.windows (#28376) next »