Hello, When I try to mysql insert values with same names, it encourages this error. When I looked at the table column, I see that the row id is always "1" and it doesnt let to add same entry. My question is, how can I add an auto increment id to that column for adding same entry names?
You just need to Alter the table, add a new column (with a name such as 'id'), make it a primary key and make it auto-increment. This will create a primary key that is auto-incremented each time you add a new name, even if that name is the same as others.
You should use command or phpmyadmin : 1. ALTER TABLE `tb_name` ADD PRIMARY KEY ( `id` ) 2. ALTER TABLE `tb_name` CHANGE `id` `id` INT( 11 ) NOT NULL AUTO_INCREMENT
Thanks but that is not working. My problem is, I can't add new user if the new user's firstname (aut_username) was used. I can add new column for firstname, but could you please tell me how to make it that lets you add same entry names.