【发布时间】:2015-06-09 09:45:08
【问题描述】:
我在mysql中有以下数据,我想以这种格式回显:
数据:
名称、图片网址、链接
我想像这样动态打印它:http://screensaver.cf/screensavers.php
我不知道用户的屏幕宽度,我仍然希望它尽可能地显示宽度。
如何在 html 和 PHP 中做到这一点?
我的代码:
<?php
require("config.php");
?>
<div id="main-wrap">
<div class="container">
<div id="main">
<div id="content"><div id='wsite-content' class='wsite-elements wsite-not-footer'>
<div class="paragraph" style="text-align:left;">
<?php
$sql='SELECT * FROM `games` where 1=1';
$data = mysql_query($sql);
echo '<h4 class="result">Result:</h4>';
while($row = mysql_fetch_row($data)){
$table=WHAT TO DO HERE TO MAKE IT LOOK LIKE THAT???????
echo $table;
echo '<br><br>';
}
?>
</div>
</div>
</div>
</div>
</div>
<?php
include("footer.php");
?>
P.S 我知道 mysql 已经贬值了,我一直在努力学习 mysqli,因为我在 8th class,所以我没有太多时间。
【问题讨论】: