Download a zip folder of selected files

remove the brackets from your name=”checked”
It should just be <input type="checkbox" name="checked" value="<?php echo $path; ?>">

Which would only return one value, so you cant do a foreach loop on one value. You need multiple input fields and then put those values into an array to use in the foreach loop

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)