<?php
$username =$_get[' uid ']; Get a value as a query condition
$result = $db->query ("SELECT * from-trip where author= '". $username. "");
$num _cats= $result->num_rows; Whether there is a return row
if ($num _cats==0)//If NULL is not shown
echo "<div class=\" empty\ "></div>
<div class=\ "cb\" ></div> ";
$res _array=array (); Define an array
for ($count =0; $row = $result->fetch_assoc (); $count + +) {//The results returned by the database are stored in an array set
$res _array[$count]= $row;
}
if (count ($res _array) >0) {
echo "<ul>
<li style= ' text-align:center;width:100px;float:left; ' ><a> Topics </a></li>
<li style= ' text-align:center;width:100px;float:left; ' ><a> dates </a></li>
<li style= ' text-align:center;width:100px;float:left; ' ><a> author </a></li>
<li style= ' text-align:center;width:150px;float:left; ' ><a> Browse </a></li> </ul><br>
<ul> ";
foreach ($res _array as $rows) {//Loop output array value
echo "<br><li style= ' text-align:center;width:100px;float:left; ' > ". $rows [' title ']. "</li>
<li style= ' text-align:center;width:100px;float:left; ' > ". $rows [' Time ']. "</li>
<li style= ' text-align:center;width:100px;float:left; ' > ". $rows [' Author ']. "</li>
<li style= ' text-align:center;width:100px;float:left; ' > ". $rows [' Scan ']. "</li>";
}
echo "</ul>";
}
?>
PHP read database table display to foreground