Forum Moderators: open
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?
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..
Or does anyone has a better idea?