【发布时间】:2017-10-29 20:26:25
【问题描述】:
我正在尝试以这种方式获取我的 mysql 数据,每行 5 张照片,最多 2 行这似乎不起作用,因为循环不断复制我拥有的 2 行中的照片。
这是我的代码:
<table border="1" width="%">
<?php
while($info = mysql_fetch_array( $data ))
{
for ($tr=1;$tr<=3;++$tr)
{
echo "<tr>";
for ($td=1;$td<=5;++$td)
{
echo "<td><img width=125 height=125 src=images/".($info['photo']). "></td>";
}
echo "</tr>" ;
}
}
?>
</table>
请帮我解决这个问题,结果一直处于这种状态:
【问题讨论】:
标签: php html mysql html-table fetch