There is an input in the HTML to display the data retrieved from the backend.
PHP files from the database to get the data operation also understand
Now is not quite understand the whole process of interaction is what ~
Reply content:
There is an input in the HTML to display the data retrieved from the backend.
PHP files from the database to get the data operation also understand
Now is not quite understand the whole process of interaction is what ~
Using the framework will help you assign an address to the MVC and then display it without using the framework to nest back-end data requests directly on an HTML page and then populate to input
Code
None Title Document
message content
number |
user |
title |
content |
publish time |
!--? php$link=mysql_connect (' localhost ', ' root ', ' 123 ') or Die ("database connection Failed");//Connection Database mysql_select_db (' Lyb ', $link);// Select Database mysql_query ("Set names UTF8");//Set Encoding format $q= "SELECT * from Content";//Set Query instruction $result=mysql_query ($q);//Execute Query while ($ ROW=MYSQL_FETCH_ASSOC ($result))//The result result set query results in a {echo "
". $row ["id"]. " |
. $row ["username"]. " |
. $row ["title"]. " |
. $row ["Content"]. " |
. $row ["Lastdate"]. " |
";}? >
return
First of all, according to our demand, there are two ways to achieve!
1. As a wamp environment, beginners to learn PHP backend novice, we first look at the Php+html Hybrid implementation method:
index.php File Contents:
测试PHP+HTML混合
2. As a back-end PHP, many times we need to integrate data to the front-end, after learning JavaScript, we can take the asynchronous interactive way from the backend to get query results updated to the input
input domain.
In the project we usually implement in the latter way.
For more information, these keywords are available for your reference:
Javascript
ajax
js异步交互
You can use the JQuery
library to experience better JavaScript hack processes.