Go Back   Webmaster Malaysia Forum » Website Design & Development » Website Programming

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 01-08-2005, 05:21 PM
Jacky's Avatar
Novice Webmaster
 
Join Date: Jul 2005
Location: KL
Posts: 68
Rep Power: 43
Jacky is on a distinguished road
Question #1062 - Duplicate entry '3' for key 1

phpMyAdmin throws #1062 - Duplicate entry '3' for key 1. Is this a bug or something like that in mysql or phpMyAdmin?

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-08-2005, 10:55 AM
heterozigot's Avatar
Novice Webmaster
 
Join Date: Jan 2003
Location: PJ
Posts: 51
Rep Power: 73
heterozigot is on a distinguished road
Send a message via ICQ to heterozigot Send a message via Yahoo to heterozigot
Quote:
Originally Posted by Jacky
phpMyAdmin throws #1062 - Duplicate entry '3' for key 1. Is this a bug or something like that in mysql or phpMyAdmin?

This is happen because the field that you set is unique, means NO DUPLICATE. When you try to insert or update data with existing value..the MYSQL error occur...this is not a BUG.
__________________
Try and Support Malaysia Product.
http://foto.home.net.my
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 03-08-2005, 10:28 AM
Jacky's Avatar
Novice Webmaster
 
Join Date: Jul 2005
Location: KL
Posts: 68
Rep Power: 43
Jacky is on a distinguished road
Then I believe is phpmyadmin bug (at least the version I am using). I didn't try to insert a duplicate value into the primary key, I merely checked on the "insert another new row" option when you want to insert a record...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-08-2005, 10:09 AM
heterozigot's Avatar
Novice Webmaster
 
Join Date: Jan 2003
Location: PJ
Posts: 51
Rep Power: 73
heterozigot is on a distinguished road
Send a message via ICQ to heterozigot Send a message via Yahoo to heterozigot
Im sure this happen because 'unique field', please remember, not only primary key is unique, other field also can set to unique if you set to index key. If you left NULL value for this field, when you insert new record, please make sure it is NOT NULL value.
__________________
Try and Support Malaysia Product.
http://foto.home.net.my
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 17-08-2005, 04:18 PM
ZeMMs's Avatar
New kid on the block
 
Join Date: Aug 2005
Location: Ampang
Posts: 8
Rep Power: 0
ZeMMs is on a distinguished road
Send a message via MSN to ZeMMs Send a message via Yahoo to ZeMMs Send a message via Skype™ to ZeMMs
By observing on the error you pasted... i'm guess you're having trouble with your primary key. Try to check the primary key to be auto-incremented so that whenever you insert a new record, the primary key is automatically incremented by 1. This way, duplication of primary key won't happen.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Duplicate entry '' for key 2 nurulmajdi Website Programming 1 06-02-2004 04:35 PM


All times are GMT +8. The time now is 01:50 PM. Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.1.0 vBulletin skin by ForumMonkeys.com.


WebmasterMalaysia.com is Proudly Hosted by Exabytes Semi Dedicated Server.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61