Actually I need a php script to synchronise two mysqldatabases so any change made to one add/edit/delete to be also updated to the other .
Lets call Database1 and Database2
The two databases will be synch via email attachments so I need changes from the one to the other database to be recorded to text files .
Also I already have an audit table in my database which automatically records any
change made to any table and field on the format you see on the attached mysql databases, your script will read that table and transfer changes as described on that table only .
Also both databases will import/export changes as described in ope064_ssa_audit table , so we are talking for two-way synch .
So the Freelancer that will do the job should carefully ready the requirements ,see my “ope064_ssa_audit” which is the audit table ,and before accept the job to come with questions etc.
I will not accept Freelancers that will accept the job and then say that the did not read the requirements I will rate them badly .
I need a php script to perform following operation .
Attached mysql tables
1. Export from Database1
See mysql “ope064_ssa_audit” table .
That table contain following columns :
- User ( that contains the user details i.e. admin , chris , john )
- Table ( specifies the table name that the changes made)
- Action ( change action made i.e. edit or add or delete )
- Description ( there is recorded the change made on the table )
- Flag ( if flag = 0 then the changes not yet send to the other database , if flag=1 changes send and logged )
- Importexportlog ( if flag = 0 then that field is empty , once user is ready to sent changes made then click the button that runs your php script which collects the flag=1 rows information and prepare a text file to a folder path , writes on importexportlog field that next export sequence performed i.e. ATH001,ATH002,ATH003 ETC. and turn flag from 1 to 0.)
Then your script must write to table ‘exportlog’ field ‘exportlog’ same value that you enter on table “ope064_ssa_audit” field importexportlog. i.e. ATH001 OR ATH002 ETC.
The text file that is created from above operation must also include a checksum for use in building hash indexes so if the information in the text somehow is changed from user to not imported from to the other mysqldatabase and request again to resend it .
THE text file should named same with importexportlog i.e. ATH001 etc.
2. Import to Database 2 ( which contains same tables with database 1)
- User will get an email that will contain the text file attachment send via the export operations and will copy/paste it to a specific folder path i.e. C:/import
- Then will push the button that will run your php import script that will read it and will import / update / delete the rows of the tables.
- Important checksum must return an error if any column is of noncomparable data type and pop up a window to user and say “please request again import file No. ATH001” or whatever is the name .
- Also if user try to import ATH003 text file for example and in the database previously only added ATH001 And not ATH002 then again must pop up a window and advise user that “Import Operation of ATH003 was not performed because import ATH002 is missing from the records” I assume that to do so must be checked that importlog table records the files already imported