Previous Thread
Next Thread
Print Thread
Hop To
#188192 06/22/2007 3:18 PM
Joined: Feb 2007
Posts: 9
N
stranger
stranger
N Offline
Joined: Feb 2007
Posts: 9
I am getting duplicate key error when I try to add a new post. Any idea where the Key gets generated so I can change the value?

Copy of the error.

Script: /usr/local/www/vhosts/ncdeer.com/htdocs/ncdeerfourm/scripts/addpost.inc.php
Line#: 470
SQL Error: Duplicate entry '193310' for key 1
SQL Error #: 1062
Query: INSERT INTO ubbt_POSTS (POST_PARENT_ID,TOPIC_ID,POST_IS_TOPIC,POST_POSTED_TIME,POST_POSTER_IP,POST_SUBJECT,POST_BODY,POST_DEFAULT_BODY,POST_IS_APPROVED,POST_ICON,POST_HAS_POLL,POST_HAS_FILE,POST_MARKUP_TYPE,USER_ID,POST_PARENT_USER_ID,POST_ADD_SIGNATURE,POST_LAST_EDITED_TIME) VALUES ( 0 , 17627 , 1 , 1182525335 , '199.82.243.71' , 'Test Post' , 'I am attempting to create a new entry after the restart.' , 'I am attempting to create a new entry after the restart.' , 1 , 'book.gif' , 0 , 0 , 'markup' , 3 , 0 , 1 , 0 )

Please use your back button to return to the previous page.

ncdeer #188195 06/22/2007 3:24 PM
Joined: Nov 2006
Posts: 3,097
Likes: 1
Carpal Tunnel
Carpal Tunnel
Joined: Nov 2006
Posts: 3,097
Likes: 1
I've seen this before but don't recall the exact fix. Basically that post already exists. As I recall it was something to do with our import from an upgrade. You can manually go into the database and remove that entry but that might not be the real fix.

What version of PHP, MySQL, and UBBT are you running?

ntdoc #188197 06/22/2007 3:27 PM
Joined: Jul 2006
Posts: 4,057
Joined: Jul 2006
Posts: 4,057
yeh i just done a search no luck frown


BOOM !! Version v7.6.1.1
People who inspire me Isaac ME Gizmo
Mark S #188201 06/22/2007 3:33 PM
Joined: Jun 2006
Posts: 9,242
Likes: 1
R
Former Developer
Former Developer
R Offline
Joined: Jun 2006
Posts: 9,242
Likes: 1
Sounds like your auto_increment field is a bit out of sync. Try running this MySQL query:

repair table ubbt_POSTS

Mark S #188203 06/22/2007 3:33 PM
Joined: Feb 2007
Posts: 9
N
stranger
stranger
N Offline
Joined: Feb 2007
Posts: 9
ubbt 7.0.2 php version 4.3.10 and version 4.1 of mysql

When I do a query of the table the max POST_ID on the table I
get 193309 so it looks as if the auto increment is working. Not sure what the problem could be.

ncdeer #188204 06/22/2007 3:34 PM
Joined: Feb 2007
Posts: 9
N
stranger
stranger
N Offline
Joined: Feb 2007
Posts: 9
running the repair now

ncdeer #188212 06/22/2007 3:47 PM
Joined: Feb 2007
Posts: 9
N
stranger
stranger
N Offline
Joined: Feb 2007
Posts: 9
That seem to fix the problem. Thanks, I probably should run it on all the tables to insure they are ok

ncdeer #188290 06/22/2007 6:53 PM
Joined: Jun 2006
Posts: 16,532
Likes: 150
UBB.threads Developer
UBB.threads Developer
Joined: Jun 2006
Posts: 16,532
Likes: 150
the "analyze" command will be much faster than "repair" and will actually tell you if there is problems.


I am a Web Development Contractor, I do not work for UBBCentral. I have provided free User to User Support since the beginning of these support forums.
Do you need Forum Install or Upgrade Services?
Forums: A Gardeners Forum
UBB.threads: UBBWiki, UBB Styles, UBB.Sitemaps
Longtime Supporter & Resident Post-A-Holic
VNC Web Services: Code Modifications, Upgrades, Styling, Coding Services, Disaster Recovery, and more!

Link Copied to Clipboard
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Recent Topics
PHP 8 bug in membermanage.tmpl
by phoenix011235 - 09/08/2026 7:47 PM
Are any of these legitmate?
by Baldeagle - 09/06/2026 1:37 PM
After server reboot
by Morgan - 09/02/2026 8:27 AM
Email Settings
by Outdoorking - 05/13/2026 2:44 AM
Who's Online Now
0 members (), 171 guests, and 128 robots.
Key: Admin, Global Mod, Mod
Random Gallery Image
Latest Gallery Images
Ride safe!
Ride safe!
by Morgan, December 7
Los Angeles
Los Angeles
by isaac, August 6
3D Creations
3D Creations
by JAISP, December 30
Artistic structures
Artistic structures
by isaac, August 29
Powered by UBB.threads™ PHP Forum Software 8.1.0
(Snapshot build 20260527)