CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 customized database settings at runtime

Print topic Send  topic

Author Message
clahti2

Posts: 107
Posted: 03/08/2012, 8:07 PM

Hello all:

I think this should be easy however I don't see an obvious way to do this. I have a project where this will be installed on multiple servers, the mysql database details may not be the same as what is hard coded into the project. So I need to dynamically set the following attributes from an INI file or something to that effect. Essentially change the hard coded values from the project file to something evaluated at runtime, such as (taken from Common.php):

  
$CCConnectionSettings = array (  
    "foo_data_connection" => array(  
        "Type" => "MySQL",  
        "DBLib" => "MySQL",  
        "Database" => "[%DATABASE%]",  
        "Host" => "[%HOST%]",  
        "Port" => ""[%PORT%]",  
        "User" => ""[%USER%]",  
        "Password" => "[%PASSWORD%],  
        "Persistent" => false,  
        "DateFormat" => array("mm", "/", "dd", "/", "yyyy", " ", "HH", ":", "nn", ":", "ss"),  
        "BooleanFormat" => array("true", "false", ""),  
        "Uppercase" => false  
    ),   
)  

There must be a way to do this without hacking the generated code in Common.php, but do it in a global way so I don't have to do it on every 300+ pages in the project. Any ideas?

View profile  Send private message
bannedone


Posts: 273
Posted: 03/08/2012, 9:57 PM

example

$CCConnectionSettings["foo_data_connection"]["Database"]="value";

_________________
John Real
CodeCharge Studio Support, Training, Consulting, Development, Web based solutions
http://realsites.biz
http://ccselite.com
Other Banned IDs on this Forum. jjrjr1, jjrjr2
View profile  Send private message
DataDoIT
Posted: 03/09/2012, 6:41 AM

The first thing that comes to my mind is data table partitioning.
http://dev.mysql.com/doc/refman/5.1/en/partitioning.html

However, if implemented it'll still require some sort of hack to the
db_mysql.php code.

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.