So in your code, you have two sintax error, one in your SQL insert and other at your while loop:
id INT (6) UNSIGNED AUTO_INCREMENT PRIMARY KEY,
AUTO_INCREMENT
comes with an underscore in between, check this SQLfiddle, and :
while ($row = mysqli_fetch_assoc($result)){
you have to remember to close all the brackets you open, these changes should fix your code.
If you need a syntax checker in the future for php I would use phpcodechecker if you don't have a built-in one.
Hope this helps you.