$username=$_GET['uid']; //获取一个值作为查询条件
$result=$db->query("select * from trip where author='".$username."'");
$num_cats=$result->num_rows;//是否有返回行
if($num_cats==0)//如果没有显示空
echo "
$res_array=array();//定义一个数组
for($count=0;$row=$result->fetch_assoc();$count++){//把数据库返回的结果存入一个数组集
$res_array[$count]=$row;
}
if(count($res_array)>0){
echo "
题目日期作者浏览";
foreach($res_array as $rows) {//循环输出数组值
echo "
" . $rows['title'] . "" . $rows['time'] . "" . $rows['author'] . "" . $rows['scan'] . "";
}
echo "
";
}
?>