I want to display data from different columns into my html page.
<?php
require '../../config.php';
$connection = new mysqli($servername, $username, $password, $db);
$query = "SELECT * FROM Empresa WHERE id='3'";
$result = $connection->query($query);
?>
<div class="col-md-6">
<h3> <?php
while ($row = mysqli_fetch_array($result)) {
echo $row["name"]; }
?> </h3>
<br>
<p><?php
while($row = mysqli_fetch_array($result)) {
echo $row["description"];}
?></p>
</div>
On the first instance it works fine no matter what column I call but after the first loop it never displays anything again.
Thanks in advance!