A
A
Arslanali2018-05-18 10:06:35
PHP
Arslanali, 2018-05-18 10:06:35

How to correctly work out two include on the page?

5afe7ae209185535454385.jpeg5afe7aef922f6704458617.jpeg5afe7af8027c7856844472.jpeg
The page is not completely displayed with two active include's.
There are two inclusions.
One displays statistics on the book and the other video tutorials on it.
With deactivation (commented out) of one include, the second one works fine (and vice versa) displaying the entire index page entirely.

<?php

require 'db.php';

 $query = "select * from unch_statistic;";
 $statistics = db::getInstance()->get_result($query);
?>

<div class="container">
  <div class="row">
    <?php foreach ($statistics as $statistic): ?>
     <div class="col-lg-3 col-md-6">
 	     <div class="single-counter">
        <h1 class="counter"><?=$statistic['counter'];?></h1>
        <p><?=$statistic['name'];?></p>                                
      </div> 
     </div>
     <?php endforeach; ?>
  </div>
</div>

Similarly, I choose video lessons

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
Oleg, 2018-05-18
@Arsen2011

Now fix to require_once 'db.php';
And start learning the normal approach.
model - controller - view

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question