MySQL - id auto increment making insertion of same data

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
kabuki1985
Forum Commoner
Posts: 32
Joined: Thu Jun 15, 2006 10:19 pm

MySQL - id auto increment making insertion of same data

Post by kabuki1985 »

I set the id as primary key and also auto increment. But if i enter the same data, it will be interpretted as a different data because of the different id from the auto increment. How do i prevent it from re-entering the same data?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

check first.
kabuki1985
Forum Commoner
Posts: 32
Joined: Thu Jun 15, 2006 10:19 pm

Post by kabuki1985 »

I set another attribute in the table as unique. So that prevents me from reentering redundant data. Duplicate entry '224924' for key 2.

I am retrieving an xml data from spongecell and updating my database accordingly. So how can i only update the changes from the calendar events that i have set?
kabuki1985
Forum Commoner
Posts: 32
Joined: Thu Jun 15, 2006 10:19 pm

Post by kabuki1985 »

ok i'll look that up
kabuki1985
Forum Commoner
Posts: 32
Joined: Thu Jun 15, 2006 10:19 pm

Post by kabuki1985 »

Yes, searched on check and it work well. Never thought of that. Sorry for my noobness. :oops:
Post Reply