I'd like to move some bookmarks in one database to another. The format
of the Active PHP Bookmarks 'apb_bookmarks' table is (minorly trucated):

+------------------+------------------+------+-----+---------+-----------+
| Field            | Type             | Null | Key | Default | Extra     |
+------------------+------------------+------+-----+---------+-----------+
| bookmark_id      | int(11) unsigned |      | PRI | NULL    | auto_incr |
| group_id         | int(10) unsigned |      | MUL | 0       |           |
| bookmark_title   | varchar(255)     |      |     |         |           |
| bookmark_url     | varchar(255)     |      |     |         |           |
| bookmark_descrip | varchar(255)     | YES  |     | NULL    |           |
| bookmark_creatio | datetime         |      |     | 0000-   |           |
| bookmark_private | char(1)          |      |     | 0       |           |
| bookmark_last_hi | datetime         | YES  |     | NULL    |           |
| user_id          | int(10) unsigned |      | MUL | 0       |           |
| bookmark_deleted | char(1)          |      |     | 0       |           |
+------------------+------------------+------+-----+---------+-----------+

I want to move this into the online-bookmarks 'bookmark' table which
has the format:

+-------------+---------------+------+-----+---------+----------------+
| Field       | Type          | Null | Key | Default | Extra          |
+-------------+---------------+------+-----+---------+----------------+
| user        | char(20)      |      |     |         |                |
| title       | char(70)      |      | MUL |         |                |
| url         | char(200)     |      |     |         |                |
| description | char(200)     | YES  |     | NULL    |                |
| private     | enum('0','1') |      |     | 0       |                |
| date        | timestamp(14) | YES  |     | NULL    |                |
| childof     | int(11)       |      |     | 0       |                |
| id          | int(11)       |      | PRI | NULL    | auto_increment |
| deleted     | enum('0','1') |      |     | 0       |                |
+-------------+---------------+------+-----+---------+----------------+

The only field mappings I care about are:

 bookmark_title       -> title
 bookmark_url         -> url
 bookmark_description -> description

Now I know I can generate insert statements and then run that script on
the target but is there a better way? The databases do not have direct
access as each is running on localhost only.

Thanks,
Mike


-- 
A program should be written to  model the concepts of the task it
performs rather than the physical world or a process because this
maximizes the  potential for it  to be applied  to tasks that are
conceptually similar and, more  important, to tasks that have not
yet been conceived.

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to