PDA

View Full Version : Error Number : 1062



sweet_kuwaiti
Thu 4th Jun '09, 2:01pm
Steve Machol (http://www.vbulletin.com/forum/member.php?u=656)

sir i have done all what you was saying on this link

http://www.vbulletin.com/forum/showthread.php?t=309378&highlight=Error+Number+1062

im trying to add new post

but i saw this again !!

Database error in vBulletin 3.8.2:
Invalid SQL:
INSERT INTO postlog
(postid, useragent, ip, dateline)
VALUES
(-1, 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; InfoPath.1; InfoPath.2; MSN Optimized;US)', 3559591425, 1244137919);
MySQL Error : Duplicate entry '0' for key 1
Error Number : 1062
Request Date : Thursday, June 4th 2009 @ 08:51:59 PM
Error Date : Thursday, June 4th 2009 @ 08:51:59 PM
Script : http://www.xxxxxxxx/newthread.php?do=postthread&f=41 (http://www.forum.appledive.net/newthread.php?do=postthread&f=41)
Referrer : http://www.xxxxxxxx/newthread.php?do=newthread&f=41 (http://www.forum.appledive.net/newthread.php?do=newthread&f=41)
IP Address : xxxxxxxx
Username : xxxxxxxx
Classname : vB_Database
MySQL Version : 5.0.77-community

i have no hooks !!!

Please help !!

Steve Machol
Thu 4th Jun '09, 2:15pm
See this page for a solution to the 'duplicate key' error:

http://www.vbulletin.com/docs/html/mysql_duplicatekey

sweet_kuwaiti
Thu 4th Jun '09, 2:47pm
Error

SQL query:
ALTER TABLE `postedithistoryid` CHANGE `postedithistoryid` `postedithistoryid` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT ;


MySQL said:
#1146 - Table 'applenet_vb.postedithistoryid' doesn't exist

Im waiting for you sir ...

Steve Machol
Thu 4th Jun '09, 2:51pm
You need to add the appropriate table prefix to that query.

sweet_kuwaiti
Thu 4th Jun '09, 2:57pm
Ok can you help me with the Number of fields

what number i have to add in the box ??

Steve Machol
Thu 4th Jun '09, 2:59pm
What do you mean?

sweet_kuwaiti
Thu 4th Jun '09, 3:01pm
can you help me with a text file ??

let me import it ...

Steve Machol
Thu 4th Jun '09, 3:05pm
Sorry I still don't understand what you are asking. You'll need to explain.

sweet_kuwaiti
Thu 4th Jun '09, 3:16pm
I need mysql code to create new table

just type it in a text file

i`ll import it from phpmyadmin :)

Steve Machol
Thu 4th Jun '09, 3:18pm
Which table exactly?

sweet_kuwaiti
Thu 4th Jun '09, 3:27pm
This tabele postedithistoryid !

sweet_kuwaiti
Thu 4th Jun '09, 3:30pm
ok can you give me a config file with appropriate table prefix to that query ??

Steve Machol
Thu 4th Jun '09, 3:31pm
First of all, are you missing that table? Second, are you using a table prefix?

sweet_kuwaiti
Thu 4th Jun '09, 4:07pm
yes missing

i do not using a table prefix ...

Steve Machol
Thu 4th Jun '09, 5:37pm
Here is the complete query to recreate that table:

CREATE TABLE postedithistory (
postedithistoryid INT UNSIGNED NOT NULL AUTO_INCREMENT,
postid INT UNSIGNED NOT NULL DEFAULT '0',
userid INT UNSIGNED NOT NULL DEFAULT '0',
username VARCHAR(100) NOT NULL DEFAULT '',
title VARCHAR(250) NOT NULL DEFAULT '',
iconid INT UNSIGNED NOT NULL DEFAULT '0',
dateline INT UNSIGNED NOT NULL DEFAULT '0',
reason VARCHAR(200) NOT NULL DEFAULT '',
original SMALLINT NOT NULL DEFAULT '0',
pagetext MEDIUMTEXT,
PRIMARY KEY (postedithistoryid),
KEY postid (postid,userid)
) $enginetype=MyISAM;

sweet_kuwaiti
Fri 5th Jun '09, 9:31am
MySQL said:
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '$enginetype=MyISAM' at line 14

So what to do now ? :(

Steve Machol
Fri 5th Jun '09, 1:08pm
Try thisL:

CREATE TABLE postedithistory (
postedithistoryid INT UNSIGNED NOT NULL AUTO_INCREMENT,
postid INT UNSIGNED NOT NULL DEFAULT '0',
userid INT UNSIGNED NOT NULL DEFAULT '0',
username VARCHAR(100) NOT NULL DEFAULT '',
title VARCHAR(250) NOT NULL DEFAULT '',
iconid INT UNSIGNED NOT NULL DEFAULT '0',
dateline INT UNSIGNED NOT NULL DEFAULT '0',
reason VARCHAR(200) NOT NULL DEFAULT '',
original SMALLINT NOT NULL DEFAULT '0',
pagetext MEDIUMTEXT,
PRIMARY KEY (postedithistoryid),
KEY postid (postid,userid)
)
$enginetype=MyISAM;

sweet_kuwaiti
Fri 5th Jun '09, 3:19pm
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '$enginetype=MyISAM' at line 15

:( ??

Steve Machol
Fri 5th Jun '09, 3:35pm
Try just this then:

CREATE TABLE postedithistory (
postedithistoryid INT UNSIGNED NOT NULL AUTO_INCREMENT,
postid INT UNSIGNED NOT NULL DEFAULT '0',
userid INT UNSIGNED NOT NULL DEFAULT '0',
username VARCHAR(100) NOT NULL DEFAULT '',
title VARCHAR(250) NOT NULL DEFAULT '',
iconid INT UNSIGNED NOT NULL DEFAULT '0',
dateline INT UNSIGNED NOT NULL DEFAULT '0',
reason VARCHAR(200) NOT NULL DEFAULT '',
original SMALLINT NOT NULL DEFAULT '0',
pagetext MEDIUMTEXT,
PRIMARY KEY (postedithistoryid),
KEY postid (postid,userid)
)

Zachery
Fri 5th Jun '09, 5:11pm
What version of MySQL is your server running?

sweet_kuwaiti
Fri 5th Jun '09, 5:55pm
latest version .. !!!

sir i have 3 websites works with vbulletin 3.8.2 with no problems

one of them showing me database error !!

2 sites working greate

sweet_kuwaiti
Sat 6th Jun '09, 4:58pm
I fixed the problm :)

The problem was from vBlletin script

thank you all ..

Ranbud
Mon 8th Jun '09, 5:39pm
I see you fixed it, I have the same issue, what do I need to do?