Home >Backend Development >PHP Tutorial >How to implement a php framework series of articles mysql database
Issues to consider when implementing a mysql database package
Ease of use
Use direct sql statement operation. As long as you can write SQL statements, there will be no other learning costs.
The DBA auxiliary encapsulation class provided by the uctphp framework, you will not be able to put it down after using it.
Does it need to be explicitly initialized and connected to the database before use? Of course not.
Until the first sql statement is executed, it will not connect to the database, or even create a new db object.
dba will connect to the database at the appropriate time and perform initial character encoding operations.
Query statement. There is no need for a new query constructor and it does not provide a chained operation method, which is so complex and inefficient.
dba provides the following query auxiliary functions.
1 2 3 4 5 6 7 8 9 10 11 12 |
|
ps: Some of the above functions can provide a map function to process each row of the returned array.
Write sentences. Why should we distinguish between read and write? Obviously it can be extended to control read and write separation, double writing and other functions.
Today with various cloud databases and database middleware, implementation at the database layer is a better choice.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
*/ Dba::insertS( |
123 |
Dba::beginTransaction(); Dba::commit(); Dba::rollBack(); |