database updating...

Results 1 to 4 of 4
  1. #1
    Valued Member artikz is offline
    MemberRank
    Jan 2007 Join Date
    100Posts

    database updating...

    how i can make that one database updates another?
    example i have one database installed and i have one more but i want it to only add the parts that were not in old database , do not erasing anythig
    example in my db i have table with data1 , and there are data2 on other database , how to make only to add data2 to data 1 not to erasing table1 and making new table1 with data2 only?


  2. #2
    Enthusiast ironfalcon is offline
    MemberRank
    Apr 2005 Join Date
    PhilippinesLocation
    31Posts
    Edit the query. Open your so-called sql update file and delete the lines you don't want to be added. Ex: you just want to get the item_template table that seems to be more updated, then delete everything from the file leaving the "create table item_template" and the "insert into item_template" lines. Also, you might want to drop your executed item_template table in your sql server before re-executing your newly made db update file. Just remember to backup your files before doing everything I said.

  3. #3
    Valued Member artikz is offline
    MemberRank
    Jan 2007 Join Date
    100Posts
    ironfalcon but if it will update mustn't i change Create table to update table or no?
    example:
    CREATE TABLE `item_loot_template` (
    to
    UPDATE TABLE `item_loot_template` (
    or no?
    i must use sqlyoug or anything else?
    i want to learn to insert data in tables , if i need that , i must only leave lines isert yeah?

  4. #4
    Valued Member artikz is offline
    MemberRank
    Jan 2007 Join Date
    100Posts
    DROP TABLE IF EXISTS `account`;
    CREATE TABLE `account` (
    `id` bigint(20) unsigned NOT NULL auto_increment COMMENT 'Identifier',
    `username` varchar(16) NOT NULL default '',
    `password` varchar(28) NOT NULL default '',
    `gmlevel` tinyint(3) unsigned NOT NULL default '0',
    `sessionkey` longtext,
    `email` varchar(50) NOT NULL default '',
    `joindate` timestamp NOT NULL default CURRENT_TIMESTAMP,
    `banned` tinyint(3) unsigned NOT NULL default '0',
    `last_ip` varchar(30) NOT NULL default '127.0.0.1',
    `failed_logins` int(11) unsigned NOT NULL default '0',
    `locked` tinyint(3) unsigned NOT NULL default '0',
    `last_login` timestamp NOT NULL default '0000-00-00 00:00:00',
    `online` tinyint(4) NOT NULL default '0',
    PRIMARY KEY (`id`),
    UNIQUE KEY `idx_username` (`username`),
    KEY `idx_banned` (`banned`),
    KEY `idx_gmlevel` (`gmlevel`)
    ) ENGINE=MyISAM AUTO_INCREMENT=11 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Account System';
    what i must change in those lines to update the table , no to creat or drop?



Advertisement