I'm currently using the ezsql library. Now I want to learn another method of interacting to a mysql database using php. What extension should I use if I'm connecting to a database which is used for different transactions. Should I use pdo or mysqli or some other extension that you can recommend?
Asked
Active
Viewed 132 times
-1
-
Is there any reason you're not considering a framework? – Gevious Dec 11 '11 at 09:28
-
@Gevious: I'm not really familiar with frameworks that connects to mysql database except for ezsql. Or are you referring to frameworks like zend or codeigniter? – Wern Ancheta Dec 11 '11 at 09:34
-
Yes I was. For a medium to large project it'll be worth your while to use one...not just for DB interaction but also for a clean (mvc) architecture. – Gevious Dec 11 '11 at 18:18
1 Answers
4
mysqli and PDO both support transactions directly, and the old mysql_* functions can manually trigger a transaction by sending a "BEGIN TRANSACTION" query, and "COMMIT" or "ROLLBACK" queries when you're done.
I'd personally go for PDO, but that's just personal preference. Mysqli should be fine also.

GordonM
- 31,179
- 15
- 87
- 129