Reputation: 143
Is there any PHP open source class that can store application configuration variables in MySQL database, like Wordpress for example? I would like to store and read something like this:
$config['name'] = "test1";
$config['name']['subname'] = "test2";
in MySQL database table, and database table need to look something like this
Id | Name | Value | Parent Name Id |
1 | 'name' | 'test1' | null |
2 | 'subname' | 'test2' | 1 |
etc.
Upvotes: 0
Views: 68
Reputation: 1091
That need not have a class style. For example:
//config.php
$config['name'] = "test1";
$config['name']['subname'] = "test2";
//other php.
require_once('{path to config.php}');
echo $config['name'];
echo $config['name']['subname'];
Upvotes: 1