Re: FileMaker <=> MySQL syncing? -
08-03-2005
, 10:50 AM
Hi Richard,
I've been attempting something similar - a 'live' two-way syncing
between filemaker and MySQL, i.e., changes to data in FM being
immediately reflected in a MySQL database and vice versa.
I'm still working on a very simple scale but so far its possible for FM
users to edit/create/delete records in the normal way, with these
changes being reflected in the db.
I use two FM fields for every user editable column in the database. One
(hidden) stores the current value in the database, the other is
presented to the user and allows entry of new values. One of these user
entry fields is validated by a calculation which compares each of the
fields with its equivalent database value. Any differences cause an
automatically generated SQL statement to be executed, which updates the
information in the database. The SQL statement is executed by a script,
which is called as part of the calculation (i use a plugin called
zippScript which allows scripts to be called within calculations...).
This approach is intended for updating one record at a time but it
would be possible to write a script which traverses every record,
comparing to the database values and updating any changes.
For MySQL -> FM syncing i have a simple script that imports database
values, matching with existing FM records and inserting new ones.
I hope this makes sense and is of some help.
Regards,
Seamus |