I have a question:
In PHP, HTML and MySQL I have made an overview of products (data from database) Now each product in this list has a more info button. I want, when I click more info, that a new page is opened and that page should show more info about that product. How do I make it work that it only shows the info of that particular product?
This is the current code of the table with the overview:
<div class="col-xs-2">
</div>
<div class="col-xs-4">
<h4 class="product-name"><strong> Producten</strong></h4><h4><small></small></h4>
</div>
<div class="col-xs-6">
<div class="col-xs-6 text-right">
<h6><strong>Datum binnenkomst</strong></h6>
</div>
<div class="col-xs-4">
<h6><strong>Datum uitgave</strong></h6>
</div>
<div class="col-xs-2">
</div>
</div>
</div>
<hr>
<?php
include("connection.php");
$sql = "SELECT * FROM bedrijven";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
// output data of each row
while($row = $result->fetch_assoc()) {
echo'
<div class="row">
<div class="col-xs-2"><img class="img-responsive" style="max-height:80px;" src="' . $row["KVK"] . '">
</div>
<div class="col-xs-4">
<h4 class="product-name"><strong> '. $row["Bedrijfsnaam"] .' </strong></h4><h4><small>'. $row["Klantnummer"] .'</small></h4>
</div>
<div class="col-xs-6">
<div class="col-xs-6 text-right">
<h6><strong>'. $row["BStraatnaam"] .'</strong></h6>
</div>
<div class="col-xs-4">
<h6><strong>'. $row["BHuisnummer"] .'</strong></h6>
</div>
<div class="col-xs-2">
<a href="Moreinfo.php"> <button type="button" class="btn btn-link btn-xs">
More info
</button></a>
</div>
</div>
</div>
<hr>';
}
} else {
echo "0 results";
}
$conn->close();?>
I hope someone would help me.
It would be nice to learn more and new things;)