Re: MySQL result to Associative array

From: Date: Mon, 21 Oct 2002 14:39:04 +0000
Subject: Re: MySQL result to Associative array
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-120742@lists.php.net to get a copy of this message
On Monday 21 October 2002 22:25, Tony Crockford wrote: > > -----Original Message----- > > From: Jacob Miller > > > > Try using " instead of '. Variables are not resolved to > > their values in > > single quoted strings. > > > > while ($row = mysql_fetch_array($md_result)) > > > > { > > > > $md_ref=$row['md_ref']; > > $md_title=$row['md_title']; > > > > $myarray["$md_ref"]=$md_title; > > > > } > > Genius! > > Thanks for that - too much looking in the wrong place I guess! Also, you should use print_r() or var_dump() to help debug stuff like this. -- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * /* static from nylon underwear */

« previous php.general (#120742) next »