i have a table of users. one field is called username and is a text type. i need it to be unique but whenever it try it says there an error with something like
"field used in key context without key length"
wat can i do to fix this?
You need to make this field a "VARCHAR" field.
I would suggest choosing a limit of characters for a username.
IE.
ALTER TABLE test ADD username VARCHAR (40), ADD UNIQUE (username);