What is the difference between sqlite3 and pdo_sqlite

I am migrating my web application from a MySQL database to SQLite. I found that there are two PHP extensions for communicating with sqlite: php_sqlite3.dll and php_pdo_sqlite.dll .

Which extension is better? Or another question: what are the main differences between these extensions?

+7
php sqlite sqlite3
source share
1 answer

PDO is a wrapper for connecting to a database in PHP. It is intended to cover the functionality offered by most database management systems (MySQL, PostgreSQL ...). Thus, function calls are the same no matter which DMBS it uses. See http://php.net/manual/en/book.pdo.php . php_pdo_sqlite.dll allows you to use the PDO interface to access the SQLite database.

Another library ( php_sqlite3.dll ) is its own interface with various function calls. Any code that uses this will be able to access the SQLite database. http://php.net/manual/en/book.sqlite3.php

You may find that PDO does not match SQLite3 functionality. That is, SQLite3 can offer things that are not available through PDO or PDO, has functions that do nothing, because SQLite3 cannot support them.

The advantage of PDO is that if you want to switch again in the future (you switch once so you can do it again), you do not have to change the code. If you keep your common SQL set, you just need to change the join statement.

+15
source share

All Articles