views:

190

answers:

2

I want to use the PEAR Mail_queue package which requires the PEAR MDB2 package for database abstraction.

I currently use MySQLi for all my database queries and dont really desire using MDB2.

Would it be bad practice to use both MDB2 and MySQLi in my PHP applications at the same time?

Can anyone give me a good reason to use MDB2 over MySQLi all together?

Thanks.

+1  A: 

PEAR::MDB2 has a driver that uses mysqli, so I don't get the point of your question. If your asking:

It is good or bad to have one connection opened with mysqli_* and another opened with PEAR::MDB2

then it's not bad, but you may be opening two connections to the same database while only one could be necessary. Be aware that if you start mixing both connections in your code, you can get confused quickly when it comes to maintenance.

JP
A: 

There are no known issues with using MDB2 and any other method of connecting to a mysql database concurrently. You should be fine.

It's good practice to use MDB2 or any other abstraction layer so you can later migrate to using a different type of database server (postgresql or sqlite for example) with a minimum of fuss.

kguest