This week or continue to learn PHP, the author or the problems encountered here a brief overview.
In this, the author did not appear too big problem, but through the following study, the author found that the status of the database is still relatively heavy. The so-called database is where the data is stored. We can add, delete and modify the data through functions. But to do this, we need to find the database accurately.
The tutorial accesses TP5 database, which is accessed through MySQL in xampp.
2. V layer
V is the abbreviation of view, which means view. It is used to modify the code segment of the web page. HTML encoding is applied, and the file suffix is. HTML. The naming method is: corresponding function name.html. At the same time, we need to connect layer V and layer C, that is, to transfer data to layer V in layer C
That is to say, assign the value of $teacher to the variable teacher.
After connecting, we only need to modify the page in the V layer to the way we want. For details, please see the HTML tutorial:
In the next few sections of learning, I found a more interesting thing. Don’t panic when encountering error information, because sometimes the solution is in the next section. You can try to look down first, or browse the content of this section first, and then look carefully.
This is because the address of our delete operation is relative. When we call the function, we trigger the index trigger under the delete controller of the index module, which is different from our target address. We just need to change the address of the delete operation to the absolute address.
In this week’s talk, the problems encountered are not big, and the solutions are given in the tutorial. Some errors are specially arranged to deepen understanding. The main thing is not to knock code, but to understand.
This document [all rights reserved]（ https://github.com/yunzhiclub… 。** Without the prior written consent of the team and the author, you are not allowed to use the content of this article in any way for commercial purposes or disseminate the content through the information network** Author: Yan Fei