dtjo87679 2018-04-02 00:21
浏览 63

从其他数据库更新DataBase [关闭]

I've one php program with 2 tables : Account / Characters (dt1) And C# program with the same struct (dt2).

I would like to know the best way to update my dt2 from my dt1, and should I do.

Like if someone signs up on my php program, I save is informations in my dt1 then i would like to update in my dt2. And if user create new Characters in my c# program, I save new information in my dt2 then i would like to update my dt1

dt1 mysql dt2 MySql Server

Thank.

  • 写回答

1条回答 默认 最新

  • duanfengshang1088 2018-04-02 00:26
    关注

    Please provide a better question to answer. What are you exactly trying to accomplish, why and other specifics i.e. database type and database software?

    1) You either set up a sync/replication between the databases.

    2) Or you can programmatically process data from one DB and then update the other DB with it.


    UPDATED ANSWER

    Use the same database for both the PHP and C# program. 
    

    Just don't forget to use transactions.


    Second Update

    Use a client-server model.
    

    Create a file that will act as a server in PHP and C#. These files will answer requests for data coming to them and act as an API

    Create a file in both languages that act as the client. These files will contact the "server file" in the other programming language.

    -- Now on every piece of data that you want to keep replicated across the databases will need to run client file to update the other database.

    ------- EG-------------

    ---Actions: Some adds data to accounts table using PHP

    ---Processing that takes place: The PHP file first adds the data to its database. Then it calls the server file in C# to add the data.

    The C# server file takes the data it received from the PHP file and adds it to the database and returns the response.

    The PHP file finishes processing once it has received a response from the C# program.


    评论

报告相同问题?

悬赏问题

  • ¥30 Unity接入微信SDK 无法开启摄像头
  • ¥20 有偿 写代码 要用特定的软件anaconda 里的jvpyter 用python3写
  • ¥20 cad图纸,chx-3六轴码垛机器人
  • ¥15 移动摄像头专网需要解vlan
  • ¥20 access多表提取相同字段数据并合并
  • ¥20 基于MSP430f5529的MPU6050驱动,求出欧拉角
  • ¥20 Java-Oj-桌布的计算
  • ¥15 powerbuilder中的datawindow数据整合到新的DataWindow
  • ¥20 有人知道这种图怎么画吗?
  • ¥15 pyqt6如何引用qrc文件加载里面的的资源