SQL syntax

Status
Not open for further replies.
I just upgraded my invoice software which seems to have required a fair amount of changes to the database. After the upgrade utility made the changes, one field in one table didn't make the move.

I have a backup of the database before anything was done and looking at it, I thought I would be able to copy the "INSERT INTO" section from the backup and manually run it on the new database (with phpMyAdmin). However, when I do that, I get...

Code:
#1062 - Duplicate entry '487' for key 'PRIMARY'

My old table has hundreds, perhaps thousands of rows like this...
Code:
(487, 'r69xSV7f', 'Stain deck and railing', 1, 0, '775', '775'),

The new table has the same rows, but they look like this (missing the description)...
Code:
(487, 'r69xSV7f', '', 1, 0, '775', '775', 0, ''),

So what am I doing wrong with ...
Code:
INSERT INTO `pancake_invoice_rows` (`id`, `unique_id`, `description`, `qty`, `tax_id`, `rate`, `total`) VALUES
(487, 'r69xSV7f', 'Stain deck and railing', 1, 0, '775', '775'),
(486, 'r69xSV7f', 'Replace damaged deck boards', 1, 0, '75', '75'),
...... ;

I'm only mildly familiar with SQL and I've contacted the developer but I'm hoping somebody here can help me out so I can send a few invoices out in the morning.

Thanks
 
Status
Not open for further replies.