[Continued] [PHP Dynamic Call method] I have always had a problem with parameters. why not understand them? A. phpclassDb {& nbsp; publicstatic $ db_table; & nbsp; pulbicstatic $ db_connection; & nbsp; publicfunction _ construct (name) {& nbsp; Db :: db_ta [continued] [PHP Dynamic Call method] with parameters
In fact, I have always had a problem. Why can't I understand it?
A. php
Class Db {
Public static $ db_table;
Pulbic static $ db_connection;
Public function _ construct (name ){
Db: db_table = name;
}
}
User
A. php? Tbname = video
User B
A. php? Tbname = picture
---------------------
I have seen that the connections in many encapsulated Db objects are put in static.
Is there no problem with concurrent access?
------ Solution --------------------
The database connection word is valid only in the current program.
It doesn't matter where it is stored.
------ Solution --------------------
It doesn't matter .. Direct call.
Repeat the call or instantiate it. Use $ db-> xx
------ Solution --------------------
In php, these two users are in different spaces, each of which has a DB class... and are irrelevant (that is, static attributes are also independent)