The php background detects the data and outputs it in the html table. how does the php background find the data and output it in the html table. Background B .php and foreground a.html. The detected data is $ result, which contains id and name. How?
Reply to discussion (solution)
Online and other online
B. php:
$ Con = mysqli_connect ('localhost', 'root', 'root', 'test'); // modify the username and password by yourself. $ a = mysqli_query ($ con, 'select * from A'); // modify the table name by yourself $ html ="
| Id |
Name |
"; While ($ rel = mysqli_fetch_assoc ($ a) {$ html = $ html ."
| {$ Rel ['id']} |
{$ Rel ['name']} |
";} $ Html .'
'Your file_put_contents('a.html ', $ html );
B. php:
$ Con = mysqli_connect ('localhost', 'root', 'root', 'test'); // modify the username and password by yourself. $ a = mysqli_query ($ con, 'select * from A'); // modify the table name by yourself $ html ="
| Id |
Name |
"; While ($ rel = mysqli_fetch_assoc ($ a) {$ html = $ html ."
| {$ Rel ['id']} |
{$ Rel ['name']} |
";} $ Html .'
'Your file_put_contents('a.html ', $ html );
This is output in the PHP file. I want to output it to other html pages.
So you have to clarify your needs?
So you have to clarify your needs?
Simple, basic functions. For example, a.php and a.html. PHP queries the information and outputs it to the.html page.
Use Template technology
Use Template technology
Smarty won't be used. it's hard. The boss won't use thinkphp, so he can write it directly like this.