0

This is the sample table :

CREATE TABLE contacts
(
  id character varying NOT NULL,
  CONSTRAINT pkey_id PRIMARY KEY (id)
)

I use PHP with PostgreSQL database..if i will run my PHP code:

Example: ADD ID NUMBER <-- If i will click this, the message below will appear:

Warning: pg_query() [function.pg-query]: Query failed: ERROR: duplicate key value violates unique constraint "pkey_id" in ......

1. I can add id number.
2. I cannot add if duplicate id #'s...
3. I am really confused, why that the message appear even though i am not still adding id number?

2
Contributors
2
Replies
4
Views
8 Years
Discussion Span
Last Post by letlet_pogs
0

This is a database question or pHp?
Show the code for add id number:

I use PHP with PostgreSQL database..if i will run my PHP code:

Example: ADD ID NUMBER <-- If i will click this, the message below will appear

What query are you running?

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.