3 Replies Latest reply on Jun 22, 2014 6:21 AM by wimdecorte

    ODBC with Mysql and Global Fields

    user22756

      I'm about to begin to develop a website (PHP - MySQL) that will be monitored and followed from within FM13.


      I've got my ODBC running very smoothly into Filemaker. I can create TO's based on the MySQL-tables, use them in layouts, etc...


      But I'm wondering what is best practice on this kind of stuff.

      For instance:

      Usually, when a FM-user wants to search for a records, for instance, I have a global field in my table, to perform a "Live-Search".

      How is this done with a MySQL-table as resource?


      Or:

      Our MySQL user for the ODBC has no delete permits. Removing something is usually done by setting a flag to 0. This is because we try to avoid a user to delete records as easy as it gets in FM. Do you also use the MySQL table as a live resource, or do you sync with a local table, by script, so you can avoid accidentally deleted records?


      It's just an example, but I'm wondering how you do this?


      I'm rather new to FM, but very eager to get into it further...

        • 1. Re: ODBC with Mysql and Global Fields
          wimdecorte

          Michel Beyaert wrote:

           

           

          Usually, when a FM-user wants to search for a records, for instance, I have a global field in my table, to perform a "Live-Search".

          How is this done with a MySQL-table as resource?

           

           

          I'm assuming you are describing something like this:

          - user inputs a search request in a global field

          - hits a button or hits enter

          - a script runs to take that input and do the actual find.

           

          In that case; it does not matter to FM whether the TO that you are is a native FM table or a MySQL table, the same scripted approach will work.

           

          If you meant "how do I do this in PHP" then that's a PHP scripting question more than a FM scripting question.

           

           

          Michel Beyaert wrote:

           

          Do you also use the MySQL table as a live resource, or do you sync with a local table, by script, so you can avoid accidentally deleted records?

           

          Either way works, syncing has the downside that you need to do a sync to get the latest state.  But working with the synced data in FM can be considerably faster than working on the live MySQL data, depending on the work that needs to be done, the connection etc.

           

          There is single good way here.  Both have upsides and downsides.

          • 2. Re: ODBC with Mysql and Global Fields
            user22756

            Thank you for the reply

             

            Actually, the script is the easy part on a search, but I usually I store the search term in a global field in the same table. However, I cannot do that on a MySQL TO. Is it good practice to make a seperate table with globals and related somehow?

             

             

            The productcatalog is about 600 products, so not too large for live MySQL usage.

            But a lot will happen inside FM with the customerdata. And it will become intense to sync 10, 15 tables nicely with FM.

            • 3. Re: ODBC with Mysql and Global Fields
              wimdecorte

              Globals can be accessed from anywhere without having to create a relationship.  So yes; it a good practice to create a FM table to hold those utility global fields.

              1 of 1 people found this helpful