PHPMYadmin表Migraton

时间:2015-06-09 08:44:29

标签: php html mysql sql phpmyadmin

我需要一些关于phpmyadmin迁移的帮助

我有2个具有不同结构的表,我希望它自动将HHVM从[store]数据库复制到右行的[tbl_storefinder_stores],但不知道如何执行此操作。 / p>

enter image description here

3 个答案:

答案 0 :(得分:0)

也许你可以试试这个:

ifstream oldXML("path/to/old/xml");
ofstream newXML("path/to/new/xml");

newXML<<"<!DOCTYPE people SYSTEM \"new_xmll.dtd\">"<<endl;  //Write first line
newXML<<oldFile;    //Copy Content of old file

你可以在这里查看答案

Copy data into another table

答案 1 :(得分:0)

    UPDATE tbl_storefinder_stores
SET lat = (
    SELECT latitude
    FROM store
    WHERE <condition here> 
    LIMIT 1
)

条件必须引用tbl_storefinder_stores字段

之一

答案 2 :(得分:0)

编辑:您要运行的查询似乎是从&#39;商店获取所有记录。 table并将它们插入到tbl_storefinder_stores中,其值与此相同:

INSERT INTO tbl_storefinder_stores(store_name, store_address, lat, long)
            SELECT name, address, latitude, longitude
    from stores;

fiddle

如果要在stores表中为另一个表中的所有记录创建新记录,您可以这样做:

INSERT INTO stores(name, address, latitude, longtitude)
VALUES(
SELECT store_name, store_address, lat, long
from tbl_storefinder_stores
);

或者如果您想更新商店中的记录:

UPDATE stores
SET (name, address, latitude, longtitude)
= (select store_name, store_address, lat, long
   from tbl_storefinder_stores
   where tbl_storefinder_stores.field = stores.field) //field that is the same in both tables and won't change