You have to first remember that you have provide only 10 Character for username and 8 characters for password.

Even though if it is a varchar it will allow only 10 Charterers for Username and 8 Characters for Password and above that if you enter i am damp sure it will show you error wile inserting into the database.

Ensure updating or changing of the values that you provide for username and password in the database.

Note: By Chance if the user provided 11 Character for username and 8 Character for password too it will not be entering into the DB.

Cross Check: Try putting echo to the statement and exit the loop after that and you directly put the echoed query in MYSQL so that you can find the Error very Easy and rectify it as per the requirement you need.

And your query need to altered like this considering the id as auto-increment.