Re: Using two colomns of mysql data as key/value pairs in arrays

From: Date: Mon, 20 Oct 2003 14:58:27 +0000
Subject: Re: Using two colomns of mysql data as key/value pairs in arrays
References: 1 2  Groups: php.db 
Request: Send a blank email to php-db+get-31174@lists.php.net to get a copy of this message
Cpt John W. Holmes wrote:
while($r = mysql_fetch_assoc($result)) { $array[$r['id']] = $r['name']; } ---John Holmes...
Wonderful! Thats exactly what I was looking for! I ended up taking the array out of the equation entirly as suggested by Davic T-G, but the simplicity of your answer was exactly what I needed.

« previous php.db (#31174) next »