webERP Forum
Creating a New Company - Printable Version

+- webERP Forum (http://www.weberp.org/forum)
+-- Forum: webERP Discussion (http://www.weberp.org/forum/forumdisplay.php?fid=1)
+--- Forum: Installation Issues (http://www.weberp.org/forum/forumdisplay.php?fid=13)
+--- Thread: Creating a New Company (/showthread.php?tid=1978)



Creating a New Company - grayryder - 11-23-2013

When I create a database, my host provider creates the following unique database setting for each database, Host name, Database name, Data Base User name and Password. The only item I’m allowed to change is the Password. Running Z_MakeNewCompany.php, the database and company name is entered has to be the same as posted by an admin “The name of the directory under companies needs to match exactly with the name of the database”. In my case, each database has been created via my host provider with unique names.
But looking at the config.php file, it appears that the same $host name, DBUser and DBPassword has to be used for both databases/companys. As noted above my host provider doesn’t support or allow changing those names.
Therefore the only way I see around this is to have a complete copy of weberp installed on my host for every company with a unique URL.
Do I have a miss understanding or is the reasoning correct?



RE: Creating a New Company - Exsonqu_Qu - 11-25-2013

Hi, Gray,

I think you should require your host provider create those databases with same database user at the same host.

Thanks and best regards!

Exson


RE: Creating a New Company - grayryder - 11-26-2013

Hi Exson,
Thank for your reply.
From your reply I take it, my reasoning is correct.
Good luck telling a host provider to change it's processes/procedures. They have their reasons. I believe one reason is they want all items to be unique. Except the password which allows access only to the owner.
One way to allow multi companies to use the same date base would be to provide unique prefixes for the tables for each company. By the way, when I tried this at installation time. The prefix was added to database name and it could not be accessed.
GrayRyder


RE: Creating a New Company - kcsr - 05-21-2014

(11-26-2013, 07:13 AM)grayryder Wrote: Hi Exson,
Thank for your reply.
From your reply I take it, my reasoning is correct.
Good luck telling a host provider to change it's processes/procedures. They have their reasons. I believe one reason is they want all items to be unique. Except the password which allows access only to the owner.
One way to allow multi companies to use the same date base would be to provide unique prefixes for the tables for each company. By the way, when I tried this at installation time. The prefix was added to database name and it could not be accessed.
GrayRyder

I use bluehost. I can create databases (ControlPanel->MySQL Databases) and create users. Then assign user~database pair, e.g. for different company. I think that is norm for most providers.
Like Exson suggested, would not hurt to ask your provider. Good luck.





RE: Creating a New Company - serakfalcon - 05-23-2014

WebERP doesn't currently support database table prefixes. It's one of several ongoing things I'm looking into.

However, a workaround you could do, is this:
in config.php alter $DBUser & $DBPassword to be an arrays, with the key being the database they belong to.

so,
Code:
$DBUser = array(
    'weberp'=>'someuser',
    'weberp2'=>'anotheruser');
$DBPassword = array(
    'weberp'=>'somepass',
    'weberp2'=>'anotherpass');

And in includes/ConnectDB_mysqli.inc (assuming you're using mysqli, which you should be)

change line 17 to

Code:
$db = mysqli_connect($host , $DBUser[$_SESSION['DatabaseName']], $DBPassword[$_SESSION['DatabaseName']],$_SESSION['DatabaseName'], $mysqlport);

We'll have to do a more comprehensive solution in the future but that should work in your case.


RE: Creating a New Company - Exsonqu_Qu - 05-23-2014

Andrew,

That's great!

Best regards!

Exson