How to connect ODBC Database with PHP? Last Updated : 03 Feb, 2021 Comments Improve Suggest changes 7 Likes Like Report The Microsoft Open Database Connectivity (ODBC) is a C application programming language interface. So the applications can access data from different database management systems. The designers of ODBC aimed to make it independent of database systems and operating systems. In this article, we are using the Microsoft Access database to establish a connection. Requirements: If ODBC Drivers are installed or the old version is installed, then update to the latest version or install the driver first Start XAMPP server by starting ApacheWrite PHP script for Access database connection.Run it in a local browser.The database is successfully connected. Steps to follow for ODBC connection to an MS Access Database: Open the Administrative tools icon in your control panelDouble-click on the Data Sources (ODBC) icon inside.Choose the System DSN tab. Click on Add in the System DSN tab.Select the Microsoft Access Driver, Click FinishIn the next screen, click on select to locate the databaseGive the database a Data Source Name (DSN) as shown in the above image. Click ok. Example: The following example demonstrates the simple connection script. PHP <!DOCTYPE html> <html> <body> <?php //Storing DSN(Data Source Name created) $dsn="raj"; $user="root"; $password=""; //storing connection id in $conn $conn=odbc_connect($dsn,$user, $password); //Checking connection id or reference if (!$conn) { echo (die(odbc_error())); } else { echo "Connection Successful !"; } //Resource releasing odbc_close($conn); ?> </body> </html> Below output will be shown on the browser Output: Connection Successful ! Comment C coder36 Follow 7 Improve C coder36 Follow 7 Improve Article Tags : Web Technologies PHP PHP Programs PHP-Misc Explore PHP Tutorial 8 min read BasicsPHP Syntax 4 min read PHP Variables 5 min read PHP | Functions 8 min read PHP Loops 4 min read ArrayPHP Arrays 5 min read PHP Associative Arrays 4 min read Multidimensional arrays in PHP 5 min read Sorting Arrays in PHP 4 min read OOPs & InterfacesPHP Classes 2 min read PHP | Constructors and Destructors 5 min read PHP Access Modifiers 4 min read Multiple Inheritance in PHP 4 min read MySQL DatabasePHP | MySQL Database Introduction 4 min read PHP Database connection 2 min read PHP | MySQL ( Creating Database ) 3 min read PHP | MySQL ( Creating Table ) 3 min read PHP AdvancePHP Superglobals 6 min read PHP | Regular Expressions 12 min read PHP Form Handling 4 min read PHP File Handling 4 min read PHP | Uploading File 3 min read PHP Cookies 9 min read PHP | Sessions 7 min read Like