Jump to content

Using FMSA as an ODBC Data Source with the PHP PDO class


This topic is 3746 days old. Please don't post here. Open a new topic instead.

Recommended Posts

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('odbcbiggrin.pngriver={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 Code:
$dsn 'odbc:Driver={FileMaker ODBC};Server=localhost;Database=cwp_data;';
$pdo = new PDO($dsn"odbc""odbc");  

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.  I'm still researching the topic so it's entirely possible that I've missed something.

Link to comment
Share on other sites

This topic is 3746 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.