1

latest php has two methods of accessing sqlite database eigter by:

http://php.net/manual/en/book.sqlite3.php - interface specific to this database

or

http://php.net/manual/en/book.pdo.php

Commands in both situations are very similar ,but I do not know which of these method is faster.

I guess that PDO method is slower because of layer of abstraction that need to be implemented there... am I right ?

rsk82
  • 28,217
  • 50
  • 150
  • 240

1 Answers1

1

The disk I/O and database size will still be the main performance factors, not the PHP database driver. Whatever differences there will be minimal. But the main reason for using PDO is that it makes your database portable across different backends. If you stick to SQL-92 commands, you can easily shift from SQLite to MySQL, MSSQL, PostgreSQL, Oracle, etc. and retain 99.9% of your existing code.

bcosca
  • 17,371
  • 5
  • 40
  • 51
  • well, these two methods are not so equal as they seem like, show-stopper for me is that PDO cant bind value as FLOAT, but with SQlite specific driver this is possible $stmt->bindValue(':something', 1.01, SQLITE3_FLOAT); – rsk82 Nov 09 '10 at 18:35
  • Perhaps you should look at this: http://stackoverflow.com/questions/2718628/pdoparam-for-type-decimal – bcosca Nov 09 '10 at 18:38