[Chartjs]-Chart.js โ€“ cannot fetch result from MySQL via PHP

1๐Ÿ‘

โœ…

$result is not defined. You should use

if (!($result = $db->query($sql1))) { ...

or

$result = $db->query($sql1);

and only after you do

if (!$result) { ...

and

while ($row = mysqli_fetch_assoc($result)) { ...

Leave a comment