Post by tutifruiti » Tue Aug 11, 2009 6:14 am

Hello,

What am I doing wrong?

I installed the backup/restore module for OpenCart 1.3 and did a backup of my MySQL database successfully. I modified the records' values and then tried to restore the database and it failed. The original backup shows all values enclosed by apostrophes, I have tried to enclose and leave them out and when I tried to restore I still get an error

1. shows records in the TABLE category

TRUNCATE TABLE `category`;

INSERT INTO `category` (`category_id`, `image`, `parent_id`, `sort_order`, `date_added`, `date_modified`) VALUES (2,'BALLAST.jpg',0,1,'2009-01-31 01:04:25','2009-08-06 19:12:03');
INSERT INTO `category` (`category_id`, `image`, `parent_id`, `sort_order`, `date_added`, `date_modified`) VALUES (5,'CHRISTMASLIGHTS.jpg',0,2,'2009-01-31 01:04:25','2009-08-06 19:12:03');
INSERT INTO `category` (`category_id`, `image`, `parent_id`, `sort_order`, `date_added`, `date_modified`) VALUES (6,'SECURITYLIGHTING.jpg',0,9,'2009-01-31 01:04:25','2009-08-06 19:12:03');

2. shows the error 1064 that I get

Error: 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 'TRUNCATE TABLE `category`; INSERT INTO `category` (`category_id`, `image`, `p' at line 3
Error No: 1064
TRUNCATE TABLE `address`; TRUNCATE TABLE `category`; INSERT INTO `category` (`category_id`, `image`, `parent_id`, `sort_order`, `date_added`, `date_modified`) VALUES (2,'BALLAST.jpg',0,1,'2009-01-31 01:04:25','2009-08-06 19:12:03'); INSERT INTO `category` (`category_id`, `image`, `parent_id`, `sort_order`, `date_added`, `date_modified`) VALUES (5,'CHRISTMASLIGHTS.jpg',0,2,'2009-01-31 01:04:25','2009-08-06 19:12:03'); INSERT INTO `category` (`category_id`, `image`, `parent_id`, `sort_order`, `date_added`, `date_modified`) VALUES (6,'SECURITYLIGHTING.jpg',0,9,'2009-01-31 01:04:25','2009-08-06 19:12:03');

3. a screenshot of TABLE category

Attachments

TABLE category.gif

TABLE category.gif (51.96 KiB) Viewed 801 times


Newbie

Posts

Joined
Sat Aug 08, 2009 4:14 am

Post by hcamelion » Sat Aug 15, 2009 12:04 pm

I would be more interested in the sql command right before:

Code: Select all

TRUNCATE TABLE `category`;

User avatar
New member

Posts

Joined
Mon Jul 27, 2009 3:14 am
Location - Albany, NY, USA

Post by tutifruiti » Mon Aug 17, 2009 9:56 am

I looked further into it and there is nothing wrong with the way I did it. The problem was with the backup/restore code. Because I uploaded the same SQL commands manually to MySQL database and it took it successfully.

Newbie

Posts

Joined
Sat Aug 08, 2009 4:14 am
Who is online

Users browsing this forum: No registered users and 33 guests