You'll notice that the first three are identical, other than the database type-and then SQLite has its own syntax. Below, you can see the method to connect to some of the most popular databases. PDO_ODBC (ODBC v3 (IBM DB2, unixODBC, and win32 ODBC))Īll of these drivers are not necessarily available on your system here's a quick way to find out which drivers you have: print_r(PDO::getAvailableDrivers()) Connectingĭifferent databases may have slightly different connection methods.Koneksi dari bahasa pemrograman web (baca: PHP) yang Anda gunakan ke MySQL database, menjadi langkah awal yang sangat penting untuk dilakukan. PDO_INFORMIX (IBM Informix Dynamic Server) MySQL merupakan salah satu database yang dapat digunakan untuk penyimpanan data pada website.PDO_DBLIB (FreeTDS/Microsoft SQL Server/Sybase).At the time of this writing, the following database drivers are available: The extension can support any database that a PDO driver has been written for. When it comes to database operations in PHP, PDO provides a lot of advantages over the raw syntax. It's written primarily for people currently using the mysql or mysqli extension to help them make the jump to the more portable and powerful PDO. This tutorial isn't meant to be a complete how-to on SQL. It doesn't account for database-specific syntax, but can allow for the process of switching databases and platforms to be fairly painless, simply by switching the connection string in many instances. Introduction to PDO PDO-PHP Data Objects-are a database access layer providing a uniform method of access to multiple databases.
0 Comments
Leave a Reply. |