doushouj966020 2013-09-06 14:14
浏览 563

sqlite3和pdo_sqlite有什么区别

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

What extension is better? Or another question: what are the basic differences between these extensions?

  • 写回答

1条回答 默认 最新

  • duanhai4046 2013-09-06 14:18
    关注

    PDO is a wrapper for database connections in PHP. It's designed to cover the functionality offered by the majority of database management systems (MySQL, PostgreSQL ...) So the function calls are all the same no matter which DMBS it's using. See http://php.net/manual/en/book.pdo.php . php_pdo_sqlite.dll allows you use the PDO interface to access a SQLite databse.

    The other library (php_sqlite3.dll) is it's own interface with different function calls. Any code which uses this will only be able to access a SQLite database. http://php.net/manual/en/book.sqlite3.php

    You may find that PDO does not perfectly match the functionality of SQLite3. That is SQLite3 may offer things not available through PDO or PDO has functions which do not do anything because SQLite3 can't support them.

    The advantage of PDO is that if you want to switch again in the future (you're switching once so you may do again) then you will not have to change much code. If you keep your SQL generic enough, you'll pretty much just have to change the connection statement.

    评论

报告相同问题?

悬赏问题

  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么
  • ¥15 banner广告展示设置多少时间不怎么会消耗用户价值
  • ¥16 mybatis的代理对象无法通过@Autowired装填
  • ¥15 可见光定位matlab仿真
  • ¥15 arduino 四自由度机械臂
  • ¥15 wordpress 产品图片 GIF 没法显示
  • ¥15 求三国群英传pl国战时间的修改方法
  • ¥15 matlab代码代写,需写出详细代码,代价私
  • ¥15 ROS系统搭建请教(跨境电商用途)
  • ¥15 AIC3204的示例代码有吗,想用AIC3204测量血氧,找不到相关的代码。