Using Data From Another Database Using Data From Another Database
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Using Data From Another Database

Started by PKfanSteph, August 21, 2005, 05:31:30 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

PKfanSteph

I had a problem with my database and hadn't backed up (go ahead and smack me...).  The photos are still on my server and it's easy enough to recreate the catagories and albums and batch add the photos.  But the hard part is re-entering all the other info like title, description and such.  I had the photos in another gallery with the same filenames and have a backup of those.  The only difference is the filepath.  Is there a way to get the information into the new database besides retyping it all?

Thanks,

-- Steph

kegobeer

Use phpMyAdmin to export your albums, categories and pictures tables.  Open up the sql file and change the file paths in the pictures table data.  Import the tables into your new database.  You will then have your albums, categories, and pictures back without having to do a lot of typing.

Make sure to back up your database before attempting this.
Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots

PKfanSteph

Thanks!  I got the albums and catagories inserted OK, but when I tried the pictures, phpMyAdmin returned the following:

------------------------
SQL query:

INSERT INTO `cpg135_pictures`
VALUES ( 1, 50, 'phil_keaggy/2005-05-28/', 'pk_01720_sbb.jpg', 77636, 82233, 600, 450, 2, '2005-10-27 18:23:57', 1124588247, 1, 'Admin', 0, 0, 'Phil Keaggy', 'Phil during soundcheck', '', 'YES', 'Stephanie Bargenquast', 'May 28, 2005', 'Del Mar Fairgrounds, Del Mar, CA', 'Sony DSC-F717', 0, 1, '', '', NULL )

MySQL said:
#1136 - Column count doesn't match value count at row 1
------------------------

Any idea what I'm doing wrong?

Thanks,

Abbas Ali

Remove the last value i.e. NULL from the query.

So the new query will be


INSERT INTO `cpg135_pictures`
VALUES ( 1, 50, 'phil_keaggy/2005-05-28/', 'pk_01720_sbb.jpg', 77636, 82233, 600, 450, 2, '2005-10-27 18:23:57', 1124588247, 1, 'Admin', 0, 0, 'Phil Keaggy', 'Phil during soundcheck', '', 'YES', 'Stephanie Bargenquast', 'May 28, 2005', 'Del Mar Fairgrounds, Del Mar, CA', 'Sony DSC-F717', 0, 1, '', '')
Chief Geek at Ranium Systems