- Edited
I have two files index.php and cocoa_type_chocolate.php
I have 1 links is dark chocolate.
I want one query when I press dark with method get or post in the where argument
index.php
<a href="cocoa_type_chocolate.php?type_chocolate=dark">Dark</a>
cocoa_type_chocolate.php
mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT); $mysqli = mysqli_connect("localhost", "root","P-11fl32fg14", "cocoa"); $query = "SELECT chocolate.id_chocolate,chocolate.name_chocolate,type_chocolate.id_type_chocolate, type_chocolate.type_chocolate ,type_chocolate.id_chocolate FROM chocolate INNER JOIN type_chocolate ON chocolate.id_chocolate =type_chocolate.id_type_chocolate WHERE type_chocolate='dark'"; $result = mysqli_query($mysqli, $query); /* numeric array */ while ($row = mysqli_fetch_array($result, MYSQLI_BOTH)) { printf("%s %s %s %s %s\n", $row["id_chocolate"], $row["name_chocolate"], $row["id_type_chocolate"],$row["type_chocolate"],$row["id_chocolate"]);?> <br> <?php } ?>