PDO vs pg_* functions

后端 未结 3 687
情歌与酒
情歌与酒 2020-12-19 04:35

They both have prepared statements. pg_* is a wrapper to libpq. Right?

I like the PDO in PHP, but I\'m not going to change the database in the future. Which library

3条回答
  •  情深已故
    2020-12-19 05:04

    IMHO using the functions that approaches directly concrete DB (like pg_, oci_, mysql[i]_ etc.) is always a little bit quicker then using a PDO or any DBMS layer (Doctrine, dibi, etc.).

    But using PDO or any DBMS layer in OOP architecture should be better approach (IMHO, again), as You learn to use this layer and thus will use it on whatever DB engine is behind. Of course if You change the DB engine within the app You do not have to bother with rewriting of whole the app.

    Even if You are not planning to change the DB engine I would recommend using of PDO. But thats just my opinion :-)

提交回复
热议问题