我只想获取在PHP中不同行中的while循环的结果
if($count == 0){
$output = 'THERE WAS NO RESULTS';
}
else{
while($row = mysqli_fetch_array($query)){
$des = $row['description'];
$file = $row['name'];
$output ='<div>'.$des. '</div>';
echo "<td>";
echo "$output";
echo "<a href='".$file."'>Download</a></td>";
}
}
}
echo "</table>";
?>
我在同一行中得到所有结果。
答案 0 :(得分:0)
您是否缺少表格行标记? <tr>
if($count == 0){
$output = 'THERE WAS NO RESULTS';
}
else{
echo '<table>';
while($row = mysqli_fetch_array($query)){
$des = $row['description'];
$file = $row['name'];
echo '<tr>';
echo '<td><div>'. $des .'</div></td>';
echo '<td><a href='".$file."'>Download</a></td>';
echo '</tr>';
}
echo '</table>';
}