0

Hello Community,
I have recently been having a big of a look into connecting to a database using PDO but I'm not too sure what I should stick with, the normal way to connect to a MySql database or should I start using PDO. What would be better to use? and what does PDO have over the normal MySql code? like what can it do that the other can't.

2
Contributors
2
Replies
21
Views
3 Years
Discussion Span
Last Post by joshl_1995
1

The MySQL extension is deprecated, so will die off soon. Left is MySQLi versus PDO basically. There are some minor differences, but overall they do the same. The advantage of PDO is that it's easier to use a different database (Postgres for example) without having to rewrite your code. PDO is also OO code, whereas MySQLi can still be used procedurally. There are a lot of threads about these two in the forum, if you do a search you'll find plenty.

Edited by pritaeas

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.