Jump to content
Sign in to follow this  
francis Aneke

WHAT DO UNDERTSTAND BY THIS ERROR

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());

 

Share this post


Link to post
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.

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...