Could someone help with this question, how to create some PHP code for this,
What I want to do is to copy/manage data across from one applications database to another application's database.
For example, to copy across the
Username
Password
Address
Phone
email
fields from one to the other.
Is there a way to capture this data as the mysql instruction is passed on to add/modify/delete data in a given field?
This is because, if a bridge is created at code level, another plugin (code) may be developed which isn't tied in to this code and yet it add/modifies/deletes data to a given field.
So by doing the capture at the database level, there is no need to worry about the code and having to watch out for code additions, modifications elsewhere all the time.
INSTANCE
An instance would be
Define connection to data source database 1
Define connection to data destination database 2
Detect inctruction to database 1 to a given(defined) field A
If instruction is Add Data to field A
Then copy Data stream to be added to field A
And execute instruction to add the Data stream to database 2 field A
Field A can be "username" in each database
------------
With such psuedocode, then additional fields can be added if it's working,
e.g.
add email field in Database 1 to email field in database 2
add email field in Database 1 to email field in database 2
----------------------------
Then, if a delete instruction is sent, a similar instruction is sent to the database so that if "string" is existent in the given field, then delete
If it is a "modify" instruction, then a similar instruction is sent to the database so that if "string" is existent in the given field, then modify
Ofcourse, unlike add which does not rely on ID too much, modify and delete may at times rely on field ID. But in this case, if the field is predefined, then it would be a matter of only detecting the matching string in the field to modify or delete.
How can this be achieved?