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 } ?
```>
my code show all the dark chocolates but I want to put get in the condicion where, to show milk and white chocolate
I have index.php and cocoa_type_chocolate.php files
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 one link.
I want to change the condition where, to change between 3 chocolates milk, dark, and white.
in the condicion where I should use get.
but I have problem with the url and where condicion.