how do i count punten for each band_naw in php en so the result? i have three dropdowns the first band you select is 3 punten second 2 punten and the third is 1 punten.
here is my code:
/* Change database details according to your database */
$dbConnection = mysqli_connect('localhost', 'root', '', 'popgroep');
$query = "SELECT band_naw, SUM(punten) AS punten FROM `resultaat` ";
$result = mysqli_query($dbConnection, $query);
if (mysqli_num_rows($result) > 0) {
echo "<ul>";
while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) {
echo "<li>{$row['band_naw']} {$row['punten']}</li>";
}
echo "</ul>";
} else {
echo "Query didn't return any result";
}
my table
error said that column punten not exist but that its strange because i made it
thanks for the comments

elseyou actually returned themysqli_error($dbConnection)it would have told you that the query was failing and more importantly WHY Addini_set('display_errors', 1); ini_set('log_errors',1); error_reporting(E_ALL); mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);to the top of your script. This will force anymysqli_errors to generate an Exception that you can see on the browser and other errors will also be visible on your browser.