Array question
| From: | Emile Axelrad | Date: | Thu, 13 Jul 2000 13:24:02 +0000 |
| Subject: | Array question | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-6429@lists.php.net to get a copy of this message | ||
I want to insert into an array, $common["blah"], for each row in a table
query. I want the key to be $row["settingname"] and the value to be
$row["settingvalue"]
Can you take a look at the following code and tell me how _you_ would have
done it...
Cheers!
--------
$result = mysql_query("SELECT settingvalue FROM
commonsettings",$connection);
while ($row = mysql_fetch_array($result)) {
$common[$row["settingname"]] = $row["settingvalue"];
}