Skip to main content
Topic: multiple data bases  (Read 332 times) previous topic - next topic

multiple data bases

Hello,
Please help!
I would like use different Mysql db with one instalation !?
so far my project is simple cash flow for different shops, it is ready installed on server, works fine for one shop only! but I have 22 shops, I don't want 22 installations, they should use different db, as they don't need to see each other... so I have 22 same structure data bases and one installation...
So i have made drop down menu in index file just before log in, in order to change  db name in config.php :
define("DB_NAME", "cashflow_1");
result is Notice: Constant DB_NAME already defined in ...
so I have that problem as once constant is defined we can't change it !

So I have that fight for few days,
I have try so far to change hole config.php, it makes some other issues,
I have try undefine, I have no full control of that server, so that php plugin is not an option,
I have try true and false statment for define...
I have try delete from config.php and put  in PDOdb.php my own variable... but I'm doing something wrong
please advice?  other ideas, that could solve that?
or Where to put my variable $db_name to make it work?