I have been able to divide two variables from a mysqli query... How do i divide the number to two decimal places / toFIxed(2)
php
$Date = $_GET['date'];
$Win = 'Win';
$testsql="
SELECT
count(*) AS bet_count,
SUM(IF(result ='$Win', 1, 0)) AS win_count
FROM bets WHERE betDate = '$Date' GROUP BY betDate
";
$testresult = mysqli_query($connection, $testsql);
while ($testrow = mysqli_fetch_assoc($testresult))
{
echo "<tr>";
echo "<td class='text-center'>".($testrow['bet_count']/$testrow['win_count']). "</td>";
echo "</tr>";
}
So, the bet_count / win_count works as expected.....I just need the integer e.g. 2.371237234 to two decimal places 2.37