Jump to content

WHAT DO UNDERTSTAND BY THIS ERROR


francis Aneke

Recommended Posts

line23:Duplicate entry '1' for key 1

 

This is the line of code that has the error---->

 

$sql=mysql_query("INSERT INTO forum_answer(question_id, a_id, a_name, a_email, a_answer, a_datetime) VALUES('$id','$max_id','$a_name','$a_email','$a_answer','$datetime')") or die('line'.__LINE__.':'.mysql_error());

 

Link to comment
Share on other sites

Your database table has either a unique or primary key defined, and you're trying to insert a record with a value for that key that is already in the table. Primary and unique keys mean that every record in the table needs a different value for that column.

Link to comment
Share on other sites

@justsomeguy, I have SOLVED ii and its fine now---

Its just that am trying to insert values in an AUTO-INCREMENT PRIMARY KEY record

Thanks

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...