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?

Recommended Answers

All 8 Replies

Member Avatar for Member #733618

when you create the table you can tick auto incremente for that column... try to see options of table and tick auto increment for id...

I see the auto_increment and ticked that, but it gives this error now:

Member Avatar for Member #733618

i dont know why you see that, but i think that it would the the NULL ticked... it musn't be ticked, NULL. Dont tick null...

Tried unticked, but same error again. I think, it is a varchar row, and you cant make it auto_inc , maybe you can add another row which is auto_inc. Somebody told me that;

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.

What do you think ?

why you are apply auto_increment on 'varchar' aut_username???

Member Avatar for Member #733618

do this, apply auto increment but not varchar use int, it would work !!!

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 before.

[IMG][/IMG]

I can add new column for firstname, but could you please tell me how to make it that lets you add same entry names.

Member Avatar for Member #733618

i dont know :S

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.