1 回答
TA贡献1828条经验 获得超3个赞
仅对行进行迭代
$statement = $connect->prepare($query);
$statement->execute();
$result = $statement->fetchAll();
$total_row = $statement->rowCount();
$output = '';
if($total_row > 0)
{
$output .= '
<table class="table">
<thead>
<tr>
<th scope="col">ID</th>
<th scope="col">Region</th>
<th scope="col">Level</th>
<th scope="col">Status</th>
<th scope="col">BE</th>
<th scope="col">RP</th>
<th scope="col">Current Rank</th>
<th scope="col">Previous Rank</th>
<th scope="col">Flex Rank</th>
<th scope="col">Champions Count</th>
<th scope="col">Skin Count</th>
<th scope="col">Last Play</th>
<th scope="col">Price</th>
</tr>
</thead>
'
foreach($result as $row)
{
$output .= ' <tr>
<td>'.$row["id"].'</td>
<td>'.$row["region"].'</td>
<td>'.$row["level"].'</td>
<td>'.$row["account_status"].'</td>
<td>'.$row["be"].'</td>
<td>'.$row["rp"].'</td>
<td>'.$row["current_rank"].'</td>
<td>'.$row["previous_rank"].'</td>
<td>'.$row["flex_rank"].'</td>
<td>'.$row["champions_count"].'</td>
<td>'.$row["skins_count"].'</td>
<td>'.$row["last_play"].'</td>
<td>'.$row["price"].'</td>
</tr>
';
}
$output .= ' </table>'
}
else
{
$output = '<h3>No Data Found</h3>';
}
echo $output;
- 1 回答
- 0 关注
- 70 浏览
添加回答
举报