Differences

This shows you the differences between two versions of the page.

english:technics:database:phpwcms_guestbook [2009/10/09 13:19]
Knut Heermann (flip-flop)
english:technics:database:phpwcms_guestbook [2018/06/03 18:09] (current)
Line 3: Line 3:
====== phpwcms_guestbook ====== ====== phpwcms_guestbook ======
-How to export/import all the entries from a guest book from one db into another?  //(first into second)//+FIXME Short description
-If there is an empty table "phpwcms_guestbook" in your target db: 
-==== First db: ==== +==== Table ====
-  +
-Export only the table "phpwcms_guestbook" and its data into a file+
-{{:english:technics:database:table_export01.gif|}} 
-\\+| //**TABLE**//             ^ //TYPE//        ^ //DESCRIPTION//                           ^ //EXAMPLE//           ^ 
 +^ guestbook_id              | int(11)         | running unique ID                         | 14 . . .              | 
 +^ guestbook_cid             | int(11)         | alias ID used in guestbook contentpart    | 2                     | 
 +^ guestbook_msg             | text            | Text entry                                | TEST TEXT TEXT ...    | 
 +^ guestbook_name            | text            | User name                                 | Sir Oblong-Fitz-Oblong| 
 +^ guestbook_email           | text            | eMail adress                              | s-o-f-o@example.com   | 
 +^ guestbook_created         | int(11)         | Date of entry created                     | 1251067220            | 
 +^ guestbook_trashed         | int(1)          | 0=visible / 9=unvisble (killed)           | 0/9                   | 
 +^ guestbook_url             | text            | user url                                  | example.com           | 
 +^ guestbook_show            | int(1)          | 0=show email / 1=hide email / 2=show email as "info at mail dot com"                                   | 0/1/2                 | 
 +^ guestbook_ip              | varchar(20)     | user ip                                   | 123.345.678.91        | 
 +^ guestbook_useragent       | varchar(255)    | md5 Server HTTP_USER_AGENT                | 7ee43b2c7cd249376...  | 
 +^ guestbook_image           | varchar(255)    | User uploaded image in /filearchive/guestbook_ID/                      | 8f9b6821990fc8a7....jpg          | 
 +^ guestbook_imagename       | varchar(255)    | Name of user uploaded image               | imagename.jpg         |
-==== Generated sql file ==== 
-<code sql|h example |h> +  
--- phpMyAdmin SQL Dump +
-  -- version 3.1.3.1 +
--- http://www.phpmyadmin.net +
--- +
--- Host: localhost +
--- Generation Time: Oct 09, 2009 at 09:26  +
--- Server version: 5.1.30 +
--- PHP Version: 5.2.9+
-SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";+==== Index ====
 +| **Keyname**        ^ Type        ^ Cardinality ^ Field           ^      ---        ^
 +^ PRIMARY            | PRIMARY     | 0           | guestbook_id    |                 |
-/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; 
-/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; 
-/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; 
-/*!40101 SET NAMES utf8 */; 
--- +/* 
--- Database: `my_database_name` +------------------------------------------------------- 
--- +Keyname      Type      Cardinality      Field 
- +------------------------------------------------------- 
--- -------------------------------------------------------- +PRIMARY     PRIMARY   15               guestbook_id 
- +------------------------------------------------------- 
--- +*/
--- Table structure for table `phpwcms_guestbook` +
--- +
- +
-CREATE TABLE IF NOT EXISTS `phpwcms_guestbook` ( +
-  `guestbook_id` int(11) NOT NULL AUTO_INCREMENT, +
-  `guestbook_cid` int(11) NOT NULL DEFAULT '0', +
-  `guestbook_msg` text NOT NULL, +
-  `guestbook_name` text NOT NULL, +
-  `guestbook_email` text NOT NULL, +
-  `guestbook_created` int(11) NOT NULL DEFAULT '0', +
-  `guestbook_trashed` int(1) NOT NULL DEFAULT '0', +
-  `guestbook_url` text NOT NULL, +
-  `guestbook_show` int(1) NOT NULL DEFAULT '0', +
-  `guestbook_ip` varchar(20) NOT NULL DEFAULT '', +
-  `guestbook_useragent` varchar(255) NOT NULL DEFAULT '', +
-  `guestbook_image` varchar(255) NOT NULL DEFAULT '', +
-  `guestbook_imagename` varchar(255) NOT NULL DEFAULT '', +
-  PRIMARY KEY (`guestbook_id`) +
-) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=6 ; +
- +
--- +
--- Dumping data for table `phpwcms_guestbook` +
--- +
- +
-INSERT INTO `phpwcms_guestbook` (`guestbook_id`, `guestbook_cid`, `guestbook_msg`, `guestbook_name`, `guestbook_email`, `guestbook_created`, `guestbook_trashed`, `guestbook_url`, `guestbook_show`, `guestbook_ip`, `guestbook_useragent`, `guestbook_image`, `guestbook_imagename`) VALUES +
-(1, 10, 'TestText01', 'Sir Oblong-Fitz-Oblong', 's-o-f-o@example.com', 1251067220, 9, '', 2, '123.345.678.91', '7ee43b2c7cd249376343fc94081bc839', '', ''), +
-(2, 10, 'TestText02', 'Sir Oblong-Fitz-Oblong', 's-o-f-o@example.com', 1251067266, 0, '', 2, '123.345.678.91', '7ee43b2c7cd249376343fc94081bc839', '', ''), +
-(3, 10, 'TestText03', 'Sir Oblong-Fitz-Oblong', 's-o-f-o@example.com', 1251067512, 0, '', 2, '123.345.678.91', '7ee43b2c7cd249376343fc94081bc839', '', ''), +
-(4, 10, 'TestText04', 'Sir Oblong-Fitz-Oblong', 's-o-f-o@example.com', 1253269013, 0, '', 2, '123.345.678.92', '52a2b8d1b5080327501e101b5d3c1d55', '', ''), +
-(5, 10, 'TestText05', 'Sir Oblong-Fitz-Oblong', 's-o-f-o@example.com', 1254779030, 0, '', 2, '123.345.678.92', '52a2b8d1b5080327501e101b5d3c1d55', '', ''); +
- +
-</code> +
- +
-Open the sql file with a ascii editor and have a closer look to: +
-<code> +
-  -- Database: `my_database_name` +
- +
-  ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=6 +
-</code> +
-and change it to your needs. +
- +
-<note> +
-If you haven´t a empty target db, please have a look into for the value of **AUTO_INCREMENT**.  +
-In your generated sql file the numbering of the column guestbook_id must begin with this value!! All following entries must be nummeriert ascending. \\ +
-Set **AUTO_INCREMENT** to n+1 //(last number of guestbook_id +1)//. +
-</note>  +
- +
- +
-\\ +
- +
-==== Second db (target) ==== +
- +
-Import this file into the target db +
- +
-{{:english:technics:database:table_import01.gif|}} +
- +
- +
-==== Result ==== +
- +
-{{:english:technics:database:table_browse03.gif?962|}} +
- +
- +
-<note> +
-**guestbook cp:** \\ +
-You find the associated alias-ID of a guestbook in the db table column guestbook_cid. +
-</note>+
english/technics/database/phpwcms_guestbook.1255087145.txt.gz · Last modified: 2018/06/03 18:08 (external edit)
www.planmatrix.de www.chimeric.de Creative Commons License Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0