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;
      $tagged_array[$key] = $value;
   }


thanks!
jaxon


On 2/11/01 4:10 PM, "Jaxon" <[EMAIL PROTECTED]> wrote:

>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);
>      $key_prep="~$key";
>      $new_array=array("$key_prep => $value");
>        
>      echo $key_prep;
>      echo " assigned to ";
>      echo $value;
>}


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to