Re: PHP + MySQL
| From: | Dimiter Ivanov | Date: | Wed, 18 Jul 2007 22:12:16 +0000 |
| Subject: | Re: PHP + MySQL | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-43801@lists.php.net to get a copy of this message | ||
On 7/18/07, Dan Maret <phpdrm@gmail.com> wrote:
I just can't figure it out and Google yielded no help. I have a table named 'settings' which contains two fields, 'item' and 'content'. What I would like to do is grab that data and use the 'item' field as the name, and use the respective 'content' as the value in an array. For Example: Array ( copyright => Copyright 2007 yada yada version = > 2.15.1 ) That way I can do <?= $settings['version'] ?> Can you help point me in the right direction? Any help would be greatly appreciated!! :-D -- -DanYou need mysql_fetch_assoc() / mysql_fetch_array() functions http://www.php.net/mysql_fetch_assoc http://www.php.net/manual/en/function.mysql-fetch-array.php They come with a good examples in the manual pages.