Answer the question
In order to leave comments, you need to log in
Why does PHP code remove site footer?
I'm trying to display data from the database into separate divs, just like in online stores. The problem is that the PHP code for some reason removes the contents of the footer and does not display anything from the database. I give the PHP code itself with the function, and also an example of HTML markup. I hid the name and password from the database)))
This is an example of a code with a function where you need to read data from the database
<?php
$dbhost = "localhost";
$dbname = "";
$dbusername = "";
$password = "";
$mysqli = @new PDO('mysql:host=$dbhost, dbname = $dbname', $password, $dbusername);
function get_wheel12() {
global $mysqli;
$wheel12 = $mysqli->query("SELECT * FROM autoobuv_spb");
return $wheel12;
}
?>
<?php
include ('test.php')
?>
<?php
$wheel12 = get_wheel12();
foreach ($wheel12 as $wheel12s): ?>
<div class="element mix diameter<?php echo $wheel12s['Diametr']; ?> width<?php echo $wheel12s['Width']; ?> height<?php echo $wheel12s['Height']; ?> summer <?php echo $wheel12s['Marka']; ?>">
<div class="images">
<a href=""><img src="" alt="<?php echo $wheel12s['Marka']; ?>"></a>
</div>
<div class="spisok">
<ul>
<li><?php echo $wheel12s['Marka']; ?></li>
<li>Сезон: Лето</li>
<li>Диаметр: R<?php echo $wheel12s['Diametr']; ?></li>
<li>Ширина: <?php echo $wheel12s['Width']; ?> мм</li>
<li>Высота: <?php echo $wheel12s['Height']; ?> мм</li>
<li>Остаток: 4-5 мм</li>
<li>Количество: 2 шт.</li>
<li>Цена: 4000 руб.</li>
</ul>
</div>
</div>
<? endforeach; ?>
Answer the question
In order to leave comments, you need to log in
Somewhere in php there is an error, after which the execution stops and therefore the footer is not displayed. Enable debugging and see errors
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question