The php framework does not need to write SQL statements to call how the fields of tables in the database are implemented. This post was last edited by albb_num1 from 2014-10-2023:. it is said that many frameworks do not need to write SQL statements, it is incredible how the fields of data tables can be called by encapsulation alone. because traditional tutorials all say that databases cannot be operated without SQL statements, what is the problem? the php framework does not need to write SQL statements to call the fields of tables in the database. how can this problem be achieved?
This post was last edited by albb_num1 at 23:13:07
It is said that many frameworks do not need to write SQL statements and can call data table fields only by encapsulation. how can this be achieved? this is incredible, because traditional tutorials all say that, the database cannot be operated without SQL statements. what is the problem?
Reject posts that Post articles in Baidu. Have your own opinions
------ Solution ----------------------
This is a good implementation
Write a php class to write database operation statements to this class.
And then pass the parameter call. I do not know if it is white.
------ Solution ----------------------
Most php frameworks simulate the implementation of ORM (object relationship Ing, a conceptual and easy-to-understand method for modeling data) to a certain extent, but it is eventually translated into SQL instructions for execution.
------ Solution ----------------------
Of course, the methods in the framework are encapsulated. In the final analysis, it is also necessary to execute SQL.
Function select ($ table, $ field_array ){
$ Field = implode (',', $ field_array );
$ R = mysql_query ("select $ field from $ table ");
Return $ r;
}
The above is a simple example. the perfect writing method should be written as a class. you can find an example on the Internet.