We are going to be using PHP to read and write a Microsoft Access Database through the ODBC API. ODBC let's us connect to many databases such as PostgreSQL, Oracle, MS Access, etc. To start of, we are going to be configure PHP to enable ODBC.
Checking PDO drivers
1. In your server public folder (namely htdocs) create a php file and write the following:
<?php phpinfo(); ?>
2. Locate PDO drivers and check to see of ODBC is enabled
If you do not see this then you want to follow these instructions:
Assuming that you're using a windows machine follow these instructions
- Go to you php.ini file and find this extension extension=php_pdo_odbc.dll.
- Remove the semi-colon at the beginning of the line (if there is no semi-colon).
- Save the file and restart your Apache server
- Run your script created above again and see if ODBC is visible there