Jump to content

[SOLVED] Fetch Array?


AtomicRax

Recommended Posts

Ok, here's what I have:

 

A MySQL table named "settings" with two fields- "name" and "value"

 

I have a query that looks like this:

$query = mysql_query("SELECT * FROM settings");
$settings = mysql_fetch_array($query, MYSQL_ASSOC);

 

(Currently there is only one result, but it will not stay this way.)

 

 

 

What I want to do:

 

Call any of the settings by their name... Like $settings[example] = "my value". How ever, with this current code, $settings[name] = "example" and $settings[value] = "my value"

 

Any help? Thanks.

Link to comment
https://forums.phpfreaks.com/topic/163108-solved-fetch-array/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.