Welcome to Webune Forums.

one question we get often is how can you make a MySQL table field unique. meaning, you dont want to be the same and you want to not others to be the same. this is very usefule because you dont want to have the same field repeat again because sometimes, it can create confusion in your scripts.

Today we are going to try to help you with a simple step by step tutorial on how you can make it so that its only one value in a table and it is not repeated.


well, you can do this in your MySQL databases. for example. lets say i want to make a field called username in my users table.


PHP CODE
$sql = "ALTER TABLE 'users' ADD UNIQUE ('usersname')";