How 'bout

<?
$query = "    SELECT field_name, user_id FROM table";
$result = mysql_query($query);
while($line = mysql_fetch_assoc($result)
{
    $array[$line["user_id"]] = $line["field_name"];
}
?>
             
----- Original Message ----- 
From: "Richard Kurth" <[EMAIL PROTECTED]>
To: "Richard Kurth" <[EMAIL PROTECTED]>
Sent: Monday, February 02, 2004 7:00 AM
Subject: [PHP] Pulling two field from mysql table into an array


> 
> What is the best way to pull two fields from a mysql database and add
> the two fields to an array for each record in the table
> field_name  user_id
> 
> I need it so iI can access the array with $key and $value
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to