9 Replies Latest reply on Jan 24, 2014 9:11 AM by beverly

    Filemaker Server as ODBC data source and PHP PDO

    jgill@occu-med.com

      I am attempting to use Filemaker as an ODBC datasource in place of MySQL. I am currently running PHP 5.5.3 and am attempting to create a PDO that will utilize the Filemaker ODBC connection. However, I am unable to successfully connect to the database as I am getting an error that says "Fatal error: Uncaught exception 'PDOException' with message 'could not find driver' in /Applications/MAMP/htdocs/OMIS/core/init.php:6 Stack trace: #0 /Applications/MAMP/htdocs/OMIS/core/init.php(6): PDO->__construct('odbc:Driver={Fi...', 'odbc', 'odbc') #1 {main} thrown in/Applications/MAMP/htdocs/OMIS/core/init.php on line 6"

       

      I know that the both the Filemaker ODBC Driver and the DSN for the database exist but I'm still getting the error. The code I'm using to temporarily test the connection is:

       

      [PHP]
      $dsn = 'odbc:Driver={FileMaker ODBC};Server=localhost;Database=cwp_data;';


      $pdo = new PDO($dsn, "odbc", "odbc");
      [/PHP]


      I do have some questions. First, does the 'Server' param need to be where the DSN is configured (localhost in this case) or where the database is hosted (external server). Second, is the PDO being handled correctly here? I am unable to find any resources on using a Filemaker database with the PDO class, so I'm sort of winging it here.