html - Bootstrap columns not working when writing in php while loop -


i using bootstrap in website when adding php loop show products products shown @ end of page instead of showing in area 'product show here'.

<div class="col-sm-9 padding-right"> <div class="features_items"> <h2 class="title text-center">features items</h2> <?php function fetch($table){ $result = mysqli_query($conn,"select id ,name menshirt"); while($row = mysqli_fetch_assoc($result)) { echo  '<div class="col-sm-4"> <h2>$56</h2> p> '.$name =$row['name'].'</p> <a href="#" class="btn btn-default add-to-cart"><i class="fa fa-cart">  </i>add cart</a> </div> </div>';  } mysqli_close($conn);} ?> </div></div> 

image file

you creates function fetch isn't called. , inside open less divs closed.

<div class="col-sm-9 padding-right">     <div class="features_items">         <h2 class="title text-center">features items</h2>         <?php          $result = mysqli_query($conn,"select id ,name menshirt");         while($row = mysqli_fetch_assoc($result)) {             echo '                  <div class="col-sm-4">                 <h2>$56</h2>                 p> '. $row['name'] . '</p>                 <a href="#" class="btn btn-default add-to-cart"><i class="fa fa-cart">  </i>add cart</a>                 </div>                 <!--/div--> <!-- opened 1 div, tried close 2 -->             ';         }         mysqli_close($conn);}          ?>     </div> </div> 

Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -