$con = mysqli_connect("localhost", "root", "", "zoo");
if (mysqli_connect_error()) {
echo "Failed to connect" . mysqli_connect_error();
}
$sel = "select (quantity* bill) as total from animal inner join price on animal.id=price.animal_id group by price.animal_id";
$result = mysqli_query($con, $sel);
while ($row = mysqli_fetch_array($result)) {
echo "<tr>";
echo"<td>" . $row['total'] . "</td>";
}
Before copy and paste check your table relation column name and update accordingly.
7
solved how to Multiply 2 columns from different tables but same database mysqli php [closed]