- Edited
30%
return 59 diferents %
one while return 59 diferents %
$row["name_chocolate"] the string return the name of chocolate and % of chocolate
I want to eliminate 30%
mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);
$mysqli = mysqli_connect("localhost", "root", "P-11fl32fg14", "cocoa");
/*Warning: Undefined array key "type_chocolate" */
$Navigationhasbeenclicked= isset($_GET['type_chocolate']);
if($Navigationhasbeenclicked)
{
$query = "SELECT chocolate.name_chocolate, type_chocolate.type_chocolate FROM chocolate
INNER JOIN type_chocolate. ON chocolate.id_chocolate =type_chocolate.id_type_chocolate
WHERE type_chocolate='$_GET[type_chocolate]'";
$result = mysqli_query($mysqli, $query);
/* numeric array */
while ($row = mysqli_fetch_array($result, MYSQLI_BOTH))
{
printf("%s %s \n", $row["name_chocolate"],$row["type_chocolate"]);?> <br>
<?php
}
}
?>