Debug error on posting

This is an archive of the phpBB 2.0.x support forum. Support for phpBB2 has now ended.
Forum rules
Following phpBB2's EoL, this forum is now archived for reference purposes only.
Please see the following announcement for more information: viewtopic.php?f=14&t=1385785
wittykitty
Registered User
Posts: 74
Joined: Sat Feb 16, 2008 11:09 am

Debug error on posting

Post by wittykitty » Mon Oct 20, 2008 7:25 pm

Hello,

Just installed a fresh phpbb and have copied across all the posting text from one database to another. The clean copy seems to have solved all the problems I have in the old forum, apart from the fact I can't post! When I try, it comes up with this error: How can I fix it? Please help!


Error in posting

DEBUG MODE

SQL Error : 1062 Duplicate entry '2017' for key 1

INSERT INTO black_posts_text (post_id, post_subject, bbcode_uid, post_text) VALUES (2017, '', 'b1cf0b972d', 'test')

Line : 251
File : functions_post.php
Last edited by ric323 on Sat Nov 01, 2008 12:04 pm, edited 1 time in total.
Reason: Topic icon changed

espicom
Registered User
Posts: 17905
Joined: Wed Dec 22, 2004 1:14 am
Location: Woodstock, IL

Re: Debug error on posting

Post by espicom » Tue Oct 21, 2008 1:44 am

The database is missing some attributes... You probably did the backup using the "built in" backup utility, which is kind of dumb when it comes to newer versions of MySQL, and can't "see" some things it really needs to see.

[Fixing] 1062 Duplicate entry '0' for key 1

There may also be a knowledge base article on this; I can't remember right now (old age is interrupting my childhood).
Jeff
Fixing 1016/1030/1034 Errors | (obsolete link) | MySQL 4.1/5.x Client Error | phpBBv2 Logo in ACP
Support requests via PM are ignored!
"To be fully alive is to feel that everything is possible." - Eric Hoffer

wittykitty
Registered User
Posts: 74
Joined: Sat Feb 16, 2008 11:09 am

Re: Debug error on posting

Post by wittykitty » Tue Oct 21, 2008 5:05 pm

I'm going to have a read through the articles now, but thought I'd write this while I remembered; I'm going from old phpbb2 to new phpbb2, don't know if this makes a difference?

Okay, there is an auto increment column, that's a start...

wittykitty
Registered User
Posts: 74
Joined: Sat Feb 16, 2008 11:09 am

Re: Debug error on posting

Post by wittykitty » Tue Oct 21, 2008 5:11 pm

Whoa, that topic is really scary! I looked at fix.php, but my table is set up with a different prefix: black_ does this make a difference? Is there another way I can fix it?

http://www.site.fordescortmk2ownersclub.co.uk/black

wittykitty
Registered User
Posts: 74
Joined: Sat Feb 16, 2008 11:09 am

Re: Debug error on posting

Post by wittykitty » Tue Oct 21, 2008 6:39 pm

Okay,

The problem is the post text that I copy over. You can post fine when the table is empty (black_posts_text), the problem is when I copy over phpbb_posts_text to black_posts_text. Yes, I did change the table prefix, it's the data/structure of this table that keeps going booloo.

It's not the structure, that's exactly the same

How can I find exactly what is causing the malfunction?

User avatar
Lumpy Burgertushie
Registered User
Posts: 66574
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: Debug error on posting

Post by Lumpy Burgertushie » Tue Oct 21, 2008 7:53 pm

wittykitty wrote:Okay,

The problem is the post text that I copy over. You can post fine when the table is empty (black_posts_text), the problem is when I copy over phpbb_posts_text to black_posts_text. Yes, I did change the table prefix, it's the data/structure of this table that keeps going booloo.

It's not the structure, that's exactly the same

How can I find exactly what is causing the malfunction?
It is hard to say at this point. I would guess that your black_posts table is missing the auto increment command at the end of the table structure.
using phpmyadmin or similar, go to that table and add that attribute.

make the value one number higher than the highest number for posts in that table.


robert
I'm baaaaaccckkkk. still doing work on donation basis. PM your needs.

Premium phpBB 3.2 Styles by PlanetStyles.net

If a tree falls in the forest and nobody is there, does it make a sound?

User avatar
Brf
Support Team Member
Support Team Member
Posts: 51834
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: Debug error on posting

Post by Brf » Tue Oct 21, 2008 7:56 pm

I dont think the posts_text is supposed to be auto-increment is it? It depends on the number generated from posts. It sounds like your posts and posts_text are out of synch.

User avatar
Lumpy Burgertushie
Registered User
Posts: 66574
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: Debug error on posting

Post by Lumpy Burgertushie » Wed Oct 22, 2008 4:01 am

that is why I said black_posts and not black_posts_text.

:)

robert
I'm baaaaaccckkkk. still doing work on donation basis. PM your needs.

Premium phpBB 3.2 Styles by PlanetStyles.net

If a tree falls in the forest and nobody is there, does it make a sound?

wittykitty
Registered User
Posts: 74
Joined: Sat Feb 16, 2008 11:09 am

Re: Debug error on posting

Post by wittykitty » Wed Oct 22, 2008 6:20 pm

Thanks guys!

So just to clarify, I need to add a column at the end of the black_posts table thats auto increment.

Sorry if I'm reiterating, I'm a bit of a novice and don't want to get it wrong!

Kit

wittykitty
Registered User
Posts: 74
Joined: Sat Feb 16, 2008 11:09 am

Re: Debug error on posting

Post by wittykitty » Thu Oct 23, 2008 5:05 pm

Could someone just confirm the above for me please, just to make sure I got it right before I proceed.

Very many thanks,

Kit

User avatar
Lumpy Burgertushie
Registered User
Posts: 66574
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: Debug error on posting

Post by Lumpy Burgertushie » Thu Oct 23, 2008 9:00 pm

wittykitty wrote:Could someone just confirm the above for me please, just to make sure I got it right before I proceed.

Very many thanks,

Kit
no , the auto increment is an attribute of the post_id colum of the black_posts table.

go to phpmyadmin or whatever your host provides and find the black_posts table, browse it.
the first field is post_id
click edit
for the "extra" field, choose auto increment.


done.

robert
I'm baaaaaccckkkk. still doing work on donation basis. PM your needs.

Premium phpBB 3.2 Styles by PlanetStyles.net

If a tree falls in the forest and nobody is there, does it make a sound?

wittykitty
Registered User
Posts: 74
Joined: Sat Feb 16, 2008 11:09 am

Re: Debug error on posting

Post by wittykitty » Fri Oct 24, 2008 5:07 pm

Okay, been there, it's already auto increment! Argh!
Attachments
SQLyog.jpg
SQLyog.jpg (60.04 KiB) Viewed 251 times

User avatar
Lumpy Burgertushie
Registered User
Posts: 66574
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: Debug error on posting

Post by Lumpy Burgertushie » Fri Oct 24, 2008 9:23 pm

ok, browse that table, see what the highest number of posts is, then make sure that the value for the auto increment is one number higher .


robert
I'm baaaaaccckkkk. still doing work on donation basis. PM your needs.

Premium phpBB 3.2 Styles by PlanetStyles.net

If a tree falls in the forest and nobody is there, does it make a sound?

wittykitty
Registered User
Posts: 74
Joined: Sat Feb 16, 2008 11:09 am

Re: Debug error on posting

Post by wittykitty » Sat Oct 25, 2008 7:00 pm

Not sure I quite understand (sorry).

Say the highest number of posts is 2,000 - do I set that as the default value in the auto increment? What about the posts that are already numbered, do they need changing? Robert, you've been a star thanks so much for putting up with an idiot!! :D

User avatar
Lumpy Burgertushie
Registered User
Posts: 66574
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: Debug error on posting

Post by Lumpy Burgertushie » Sat Oct 25, 2008 8:15 pm

no, it is not the default value that you need to change.

I have no idea how to use that database program you have.
however, if you can export the posts table to your computer as a text file or sql file , then you can edit it and import it back.
make a complete database backup berfore you start this just in case.


once you have it on your computer it should look like this:

Code: Select all

--
-- Table structure for table `pinky_posts`
--

DROP TABLE IF EXISTS `phpbb_posts`;
CREATE TABLE `phpbb_posts` (
  `post_id` mediumint(8) unsigned NOT NULL auto_increment,
  `topic_id` mediumint(8) unsigned NOT NULL default '0',
  `forum_id` smallint(5) unsigned NOT NULL default '0',
  `poster_id` mediumint(8) NOT NULL default '0',
  `post_time` int(11) NOT NULL default '0',
  `poster_ip` varchar(8) collate latin1_general_ci NOT NULL default '',
  `post_username` varchar(25) collate latin1_general_ci default NULL,
  `enable_bbcode` tinyint(1) NOT NULL default '1',
  `enable_html` tinyint(1) NOT NULL default '0',
  `enable_smilies` tinyint(1) NOT NULL default '1',
  `enable_sig` tinyint(1) NOT NULL default '1',
  `post_edit_time` int(11) default NULL,
  `post_edit_count` smallint(5) unsigned NOT NULL default '0',
  PRIMARY KEY  (`post_id`),
  KEY `forum_id` (`forum_id`),
  KEY `topic_id` (`topic_id`),
  KEY `poster_id` (`poster_id`),
  KEY `post_time` (`post_time`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT=303 ;
notice the last line. the AUTO_INCREMENT=303 part.
change whatever number is there to one higher than the highest post number in the table.
you can view that with that database program you have .

make the change, save it , and then import it back to the database.
I'm baaaaaccckkkk. still doing work on donation basis. PM your needs.

Premium phpBB 3.2 Styles by PlanetStyles.net

If a tree falls in the forest and nobody is there, does it make a sound?

Locked

Return to “2.0.x Support Forum”