Php 引导组合行
目前,我有一个问题与我的投资组合网站。我想显示2行4个投资组合项目。但是现在,如果添加一个新行,项目将变得越来越大。我将附上问题的照片Php 引导组合行,php,twitter-bootstrap,Php,Twitter Bootstrap,目前,我有一个问题与我的投资组合网站。我想显示2行4个投资组合项目。但是现在,如果添加一个新行,项目将变得越来越大。我将附上问题的照片 Mijn投资组合 我认为问题存在于while循环中。因为每次它通过这个循环它都会形成一个新的行,所以它变得越来越大 我希望你们能帮我解决这个问题 ps:我正在使用引导类 亲切问候,, 凯文。问题可能是,您正在每个投资组合项目中创建行。 我认为(没有小提琴就无法确定)您应该重新定位?php}?这将关闭php例程一行(在关闭公文包项的/div之后),并在构建
Mijn投资组合
我认为问题存在于while循环中。因为每次它通过这个循环它都会形成一个新的行,所以它变得越来越大
我希望你们能帮我解决这个问题
ps:我正在使用引导类
亲切问候,,
凯文。问题可能是,您正在每个投资组合项目中创建行。
我认为(没有小提琴就无法确定)您应该重新定位?php}?这将关闭php例程一行(在关闭公文包项的/div之后),并在构建3个实例后关闭该行 问题可能是,您正在每个投资组合项目中创建行。
我认为(没有小提琴就无法确定)您应该重新定位?php}?这将关闭php例程一行(在关闭公文包项的/div之后),并在构建3个实例后关闭该行 您的循环和行错误。试试这个
<div class="row">
<div class="col-lg-12">
<h1 class="page-header">Mijn Portfolio</h1>
</div>
</div><!-- row -->
<div class="row">
<?php
// SHOW POSTS QUERY
$query = "SELECT * FROM posts";
$select_all_portfolio_items_query = mysqli_query($connection, $query);
// Display alle posts in tabel posts in blog entries column
while($row = mysqli_fetch_assoc($select_all_portfolio_items_query)){
$item_id = $row['post_id'];
$item_titel = $row['post_title'];
$item_auteur = $row['post_author'];
$item_datum = $row['post_date'];
$item_image = $row['post_image'];
$item_content = substr($row['post_content'], 0, 50);
$item_status = $row['post_status'];
if($item_status == 'published'){
?>
<div class="col-md-3 portfolio-item">
<a rel="prettyPhoto[gallery1]" class="thumbnail" title="This is a caption" href="https://www.youtube.com/watch?v=Rp19QD2XIGM">
<img class="img-responsive" src="images/<?php echo $item_image; ?>" alt="Video 1">
<h3 class="text-center"><?php echo $item_titel; ?></h3>
<small><?php echo $item_datum; ?></small>
<small>door <?php echo $item_auteur; ?></small>
<p class=""><?php echo $item_content; ?></p>
<a class="btn btn-primary" href="post.php?p_id=<?php echo $item_id; ?>">Read More <span class="glyphicon glyphicon-chevron-right"></span></a>
</a>
</div>
<?php }
} ?>
</div>
Mijn投资组合
您的循环和行错误。试试这个
<div class="row">
<div class="col-lg-12">
<h1 class="page-header">Mijn Portfolio</h1>
</div>
</div><!-- row -->
<div class="row">
<?php
// SHOW POSTS QUERY
$query = "SELECT * FROM posts";
$select_all_portfolio_items_query = mysqli_query($connection, $query);
// Display alle posts in tabel posts in blog entries column
while($row = mysqli_fetch_assoc($select_all_portfolio_items_query)){
$item_id = $row['post_id'];
$item_titel = $row['post_title'];
$item_auteur = $row['post_author'];
$item_datum = $row['post_date'];
$item_image = $row['post_image'];
$item_content = substr($row['post_content'], 0, 50);
$item_status = $row['post_status'];
if($item_status == 'published'){
?>
<div class="col-md-3 portfolio-item">
<a rel="prettyPhoto[gallery1]" class="thumbnail" title="This is a caption" href="https://www.youtube.com/watch?v=Rp19QD2XIGM">
<img class="img-responsive" src="images/<?php echo $item_image; ?>" alt="Video 1">
<h3 class="text-center"><?php echo $item_titel; ?></h3>
<small><?php echo $item_datum; ?></small>
<small>door <?php echo $item_auteur; ?></small>
<p class=""><?php echo $item_content; ?></p>
<a class="btn btn-primary" href="post.php?p_id=<?php echo $item_id; ?>">Read More <span class="glyphicon glyphicon-chevron-right"></span></a>
</a>
</div>
<?php }
} ?>
</div>
Mijn投资组合
在您的while循环中。移动它在你的while循环中。移动它非常感谢你!这解决了我的问题非常感谢!这解决了我的问题