This topic is locked

Dynamic DB connection, but also dynamic table prefix querys

7/21/2020 6:35:47 AM
PHPRunner General questions
A
axier author

Hi friends,
I've a customer with 3 different databases (3 different offices) with the same structure except the table prefix.

It's the same ERP program, but installed 3 times, one per office.
As I said, the only difference is the table prefix in each database.
For example, for the "Customers" table
DB1: Â dbo.[office_1_Prefix$Customers]

DB2: Â dbo.[office_2_Prefix$Customers]

DB3: Â dbo.[office_3_Prefix$Customers]
I know PHPRunner supports dynamic DB connections as illustrates this post:

https://asprunner.com/forums/topic/22343-how-to-make-single-project-connect-to-different-databases-passing-database-name-via-url/
But I need a step further, and make the table it self also dynamic depending of the certains conditions.

Is it possible to do this with PHPrunner?

Now I have 3 PHPRunner projects, one per office, and it's very frustrating to make one change in project and have to make the same changes in the other PHPrunner projects.

If you have any solution or way to make this possible I would be very grateful.

Thanks for your help.

Sergey Kornilov admin 7/21/2020

PHPRunner doesn't have this kind of functionality.
The correct approach would be to add a new field to the Customers table, something like LocationID or BranchID.