After doing a sort of a research through out the Internet(And here at Stackoverflow) - I'm still struggling to decide which method is best for me to learn/use and dig more when programming in PHP.
I understand some of the advantaged of using DAO when dealing with DB over using straight mysql_* functions spread out across the application files.
When it comes to decide between MDB2 vs PDO - one thing that shine in favor of PDO is the fact that it doesn't abstract the mysql_* functions it talks directly to the mysql api just as the mysql_* do. It is also a compiled C extension to PHP so is very fast. While MDB2(or other libraries) are written in PHP so they need to be parsed at runtime and sit on top of the mysql_* functions. So, In terms of speed PDO wins?!?
When it comes to compare DB abstraction layer over native-non-abstracted-PHP way shines the security advantages of DB abstraction layers in the way of using binder params(prepared statements) that will prevent most sql injection attacks, plus it is easier to switch RDBMS type in the future if there is a need/request for that - even though it is not that common - (there are other advantages and nice consuming time feature in those DAO libraries).
Anyway I hope that there are experts who can assist me to decide rather I should use one of those libraries and if so, which one is the most recommended?, or should I write my own DAO library that will serve me through all my projects and will get improved with years?.
Thanks.