Forum Moderators: open

Message Too Old, No Replies

duplicate entry key 1?

         

john1000

11:11 pm on Aug 11, 2006 (gmt 0)

10+ Year Member



ok...i dont understand this...
as im still busy to put my old downloads into a new cms im busy importing stuff and goes very slow..

im trying to do this....

INSERT new_categories
SELECT id, parent_id, title, name, image, section, image_position, description, published, checked_out, checked_out_time, editor, ordering, access, count, params FROM old_categories

But when i run that i get:

#1062 - Duplicate entry '13' for key 1

And when i hit the button to explore the error phpmyadmin shows :

#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 'WHERE CONCAT_WS("-", )
= "13"

both tables to export from and to import to are identical as i show here:

i grab the info from this old table :

id
title
description
parent_id
name
image
section
image_position
published
checked_out
checked_out_time
editor
ordering
access
count
params

and goes into this new table :

id
parent_id
title
name
image
section
image_position
description
published
checked_out
checked_out_time
editor
ordering
access
count
params

so what am i doing wrong?

stajer

12:14 am on Aug 12, 2006 (gmt 0)

10+ Year Member



It sounds like you have a unqiue key on new_categories that you don't have on old_categories. Check the parameters for each column in new_category and make sure it matches old_categories - not just the column names.

john1000

1:21 am on Aug 12, 2006 (gmt 0)

10+ Year Member



ok thanks...
ill check that in the morning....
ill reply again as soon as i checked it..

john1000

9:03 am on Aug 12, 2006 (gmt 0)

10+ Year Member



hello,

i checked everything and found one mist setting,that needed to be set to unsigned..

unfortunately that didnt help..
the error stays...

#1062 - Duplicate entry '13' for key 1

#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 'WHERE CONCAT_WS("-", )
= "13"

But a question...

Sounds maybe dumb but do the columns have to be at the same spot?

Cause the new table is like this :

id
parent_id
title
name
image
section
image_position
description
published
checked_out
checked_out_time
editor
ordering
access
count
params

and the old table like this :

id
title
description
parent_id
name
image
section
image_position
published
checked_out
checked_out_time
editor
ordering
access
count
params

But thing is.....
i made it like that....
i guess i had to otherwise it wouldnt fit..
so i changed the names ..

but the old table had only this :

cid int(11) NOT NULL auto_increment,
title varchar(50) NOT NULL default '',
cdescription text NOT NULL,
parentid int(11) NOT NULL default '0',

I hope anyone understands this..
So how can i import it to my new categories table?

I have to do it somehow..or ill loose a lot..

john1000

9:54 am on Aug 12, 2006 (gmt 0)

10+ Year Member



oh i think i understand whats wrong...
the duplicate 13 is because the new table already has a category with id 13,and the old one also...
well to be honest...and sorry for the expression...that sucks.
so now i have to alter every cat and the select every download under that cat to import it..
great :(

Or does anyone has a better idea?