[PHP] oops - wrong! (was: how to alter assoc_array?)

2001-02-11 Thread Jaxon
Okay, I don't have it :) This should be recreating a 3 row array of key:value pairs with a "~" character prepended to each key, but is only echoing _one_ key:value pair - anyone see why? while($array = mysql_fetch_array($result, MYSQL_ASSOC)) { list($key, $value) = each($array);

Re: [PHP] oops - wrong! (was: how to alter assoc_array?)

2001-02-11 Thread Jaxon
ack. ignore me. not enough coffee. the 'while' was in the wrong place. also dropped the array() in favor of array_name[] to ensure I keep it associative. $array = mysql_fetch_array($result, MYSQL_ASSOC); while (list ($key,$value) = each($array)) { $key ="~" . $key;