This article mainly introduces MySql database query results using table output PHP code example, this article directly gives the code example, need Friends can refer to it
In general websites, we usually see that the data of many database tables appear in tables in the browser. It feels amazing at first, but it is not too complicated if you think about it carefully. Since dql and dml can be returned in general, it should not be a problem to return in the form of a table. However, one thing to note is that it is wrong to design a script on the client to implement the problem. Even if it can be implemented, it is very complicated, so just You can think about it from the perspective of the server and think about the way to solve the problem, that is, print the table label and the corresponding attributes and attribute values when returning. Although this method seems unreasonable, it is also the most effective. method. The specific code is as follows:
?
12 13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
";
echo "Total".$rows."rows ".$colums."Columns "; echo "
|