Exported tables - How to Import in Database table

Hello,

I Exported a Categories table from my data base, now I want to Import into another Table,

Will the Import over write an existing table?

Or do I need to Delete the table first?

Will the SQL format below Import ok ?

INSERT INTO categories VALUES(156, 57, 'PC

Games’, 0, 0, 0, ‘’, ‘’, ‘’, ‘’, 0, ‘>’, 0, 0, 0, ‘’, ‘’, 0, 0);
INSERT

INTO categories VALUES(160, 156, ‘Children's’, 0, 0, 0, ‘’, ‘’,

‘’, ‘’, 0, ‘’, 0, 0, 0, ‘’, ‘’, 1, 1);
INSERT INTO categories VALUES

(159, 156, ‘Board Games’, 0, 0, 0, ‘’, ‘’, ‘’

no, INSERT statements only add new rows

depends what you want to happen

does the table exist already? don’t you want to create the other table first?

it’s not clear whether you want the rows added to the categories table or the new table

no, only the first two INSERT statements might work

the 3rd definitely won’t, as it’s malformed

the first 2 won’t work if there’s a primary key and those values exist already

Hello r937

ok good I think you answered all my questions, thank you,

I will go and try and see what happens, then reply once I know the results :slight_smile:

Hello,

so far no joy :slight_smile:

here is the first lines of my “Export” Categories SQL

I Exported it, now I want to Import it in a Data Base, How ? Will this Auto create the Table, then populate it?

CREATE TABLE categories (
category_id int(11) NOT NULL AUTO_INCREMENT,
parent_id int(11) NOT NULL DEFAULT ‘0’,
name varchar(100) COLLATE latin1_general_ci NOT NULL DEFAULT ‘’,
order_id int(11) NOT NULL DEFAULT ‘0’,
hidden tinyint(4) NOT NULL DEFAULT ‘0’,
items_counter int(11) NOT NULL DEFAULT ‘0’,
hover_title varchar(255) COLLATE latin1_general_ci NOT NULL DEFAULT ‘’,
meta_description mediumtext COLLATE latin1_general_ci NOT NULL,
meta_keywords mediumtext COLLATE latin1_general_ci NOT NULL,
image_path varchar(255) COLLATE latin1_general_ci NOT NULL DEFAULT ‘’,
wanted_counter int(11) NOT NULL DEFAULT ‘0’,
is_subcat varchar(5) COLLATE latin1_general_ci NOT NULL DEFAULT ‘’,
user_id int(11) NOT NULL DEFAULT ‘0’,
custom_fees tinyint(4) NOT NULL …and on and on and on :slight_smile:

yes, that looks fine

Hello r937

thank you for your reply,

yes a few minutes ago success, table created and populated,

best wishes :slight_smile: