0

I have the following file called config.php. These are configuration options for a client management system. I need these settings to be editable via the system admin panel. How would I go about storing these values in a database? Would it make sense to have a table called "config" with only one row?

<?php

// System Settings

$system_status = 0; // 0 for active, 1 for locked
$system_status_msg = 'The system is currently inactive. One Aministrators can log in.'; // Modifiable message for when the system as been disabled
$admin_email = 'mk@simplisticstyle.com'; // Set administrator email for PHP Mail Function
$site_url = 'http://localhost'; // Set root location of system
$client_max_upload = 2*1024*1024; // Maximum upload file size for clients
$staff_max_upload = 100*1024*1024; // Maximum upload file size for staff
$contract_max_upload = 5*1024*1024;
$invoice_max_upload = 5*1024*1024;


// Form Validation Settings

$pw_min = 5;

?>
3
Contributors
3
Replies
4
Views
7 Years
Discussion Span
Last Post by ElegantElephant
1

Why do you want to put all those config options in one row in a table, Instead you can create a table config and add a row for each config, this would make easier to edit the code in later.

1

if it only one configuration better use define() the constant value.

But if it is editable and you have a lots of clients with different configurations you have to search every username of the clients and apply each row configuration. Meaning your table is not only one row your table is a multiple rows of multiple users.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.