0

我正在尝试将我的 MYSQL 数据库中的详细信息显示到这些框中,我的数据库中的最后 3 个条目,我怎么能回显这个?

  <div class="row-fluid">
              <ul class="thumbnails">
                <li class="span3">
                  <div class="thumbnail">
                    <img data-src="holder.js/300x200" alt="300x200" style="width: 300px; height: 200px;">
                    <div class="caption">
                      <h3>Thumbnail</h3>
                      <p>Description 1/p>
                      <p><a href="#" class="btn btn-danger">Action</a> <a href="#" class="btn">Action</a></p>
                    </div>
                  </div>
                </li>
                <li class="span3">
                  <div class="thumbnail">
                    <img data-src="holder.js/300x200" alt="300x200" style="width: 300px; height: 200px;" >
                    <div class="caption">
                      <h3>Thumbnail label</h3>
                      <p>Desc 2.</p>
                      <p><a href="#" class="btn btn-danger">Action</a> <a href="#" class="btn">Action</a></p>
                    </div>
                  </div>
                </li>
              </ul>
            </div>
4

1 回答 1

2

根本看不到任何代码,基本思路如下:

<div class="row-fluid">
    <ul class="thumbnails">
        <?php while($rows = mysql_fetch_array($query)) { ?>
        <li class="span3">
            <div class="thumbnail">
                <img data-src="holder.js/300x200" alt="300x200" style="width: 300px; height: 200px;">
                <div class="caption">
                    <h3><?php echo $rows['title']; ?></h3>
                    <p><?php echo $rows['description']; ?></p>
                    <p> <a href="#" class="btn btn-danger">Action</a>  <a href="#" class="btn">Action</a></p>
                </div>
            </div>
        </li>
        <?php } ?>
    </ul>
</div>
于 2013-07-04T19:03:37.597 回答