On the website, there must be a unique identifier for each user. It can be the username, email-id or any string using which user can log in to the website and access it.
Before adding the user using the registration form it must be check if the username is available or not.
This can either done after submitting the form or using jQuery AJAX to display availability status before submitting the form.
In this tutorial, I show how you can check username already exists or not in the MySQL database table using jQuery AJAX PHP and PDO.