Hello,
I'm trying to change my albums permissions from "2" (registered users only) to "0" (public for everyone) all at once, so I exported the .sql file, changed all "2"'s to "1"'s, saved and then when I go to phpmyadmin to import the file, I get this error:
QuoteError
SQL query:
-- -- Dumping data for table `cpg_albums` -- INSERT INTO `cpg_albums` (`aid`, `title`, `description`, `visibility`, `uploads`, `comments`, `votes`, `pos`, `category`, `owner`, `thumb`, `keyword`, `alb_password`, `alb_password_hint`, `moderator_group`, `alb_hits`) VALUES (1, 'Posters', '', 0, 'NO', 'YES', 'YES', 100, 7, 1, 5, '', '', '', 0, 5), (217, 'Promotional Stills', '', 0, 'NO', 'YES', 'YES', 101, 26, 1, 31259, '', '', '', 0, 25), (4, 'Posters', '', 0, 'NO', 'YES', 'YES', 100, 8, 1, 570, '', '', '', 0, 4), (215, 'May 17, 2004', 'Venue: Brooklyn\r\nLocation: New York City, New York, USA', 0, 'NO', 'YES', 'YES', 4, 33, 1, 6334, '', '', '', 0, 5), (6, 'Screen Captures', '', 0, 'NO', 'YES', 'YES', 102, 8, 1, 694, '', '', '', 0, 17), (7, 'Posters', '', 0, 'NO', 'YES', 'YES', 100, 9, 1, 706, '', '', '', 0, 5), (216, 'August 6, 2004', 'Location: New York City, New York, USA', 0, 'NO', 'YES', 'YES', 5, 33, 1, 6189, '', '', '', 0, 8), (9, 'Screen Captu[...]
MySQL said: Documentation
#1062 - Duplicate entry '1' for key 1
I have over 1,000 albums so I don't want to change the permissions one by one. What do I do to fix this error?
Thanks in advance!
You need to empty the table before you import the file. Better yet, just change them all with a db query
UPDATE cpg_albums SET visibility = 0 WHERE visibility = 2
Where do I go? To "Query" and then paste "UPDATE cpg_albums SET visibility = 0 WHERE visibility = 2" in the big empty field at the bottom?
Yes. Make a backup if you're not sure what you're doing.
Did that and got this:
Quote0 row(s) affected. ( Query took 0.0017 sec )
What exactly have you done? If you already emptied your table or
Quote from: lolainslacks on August 28, 2010, 12:33:51 AM
changed all "2"'s to "1"'s
it's no wonder that the query affects 0 rows.