Problems encountered during PHP development (a project's overall design problem)
There is no user user1,user2,user3,user4,user5 ..... The user is performing the same operation, but the number of accesses during execution
According to the library different (DB1,DB2,DB3,DB4,DB5 ... )。
User1--> access to-->DB1 via PHP
User2--> access to-->DB2 via PHP
User3--> access to-->DB3 via PHP
User4--> access to-->DB4 via PHP
User5--> access to-->DB5 via PHP
..................
The above PHP program is the same program, the implementation of the same function.
What should I do to implement the above features?
------Solution--------------------
Depending on the user to choose a different database on the line.
------Solution--------------------
Your number of users is not sure, that of course the loop did create 2 arrays, a radish a pit, not just oh ke!
------Solution--------------------
Reference:
Choose a different database depending on the user.
Easy to use with him;
Reference:
Your number of users is not sure, that of course the loop did create 2 arrays, a radish a pit, not just oh ke!
Efficient and fast, with arrays
------Solution--------------------
The original is this, ~ ~
Then get the user and DB, and then pass in, not finished
------Solution--------------------
If two users access the PHP program at the same time, but the database access is different, there will be conflicts
No.
I thought it was for you.
------Solution--------------------
Here is an example, and of course you can use arrays as well.
Switch ($user)
{
Case ' user1 ':
mysql_select_db (' db1 ');
Break
Case ' User2 ':
mysql_select_db (' DB2 ');
Break
.........................
}