Jump to content
Larry Ullman's Book Forums

Is Pdo Better Or More Secure Than Mysqli?


Recommended Posts

I am not sure on this but I have re-written my website with pdo database access.  It took an a long time to make all the changes and test everything, but I am happy with it.  I just am not sure it was worth the time.  I am asking now before I implement the second site (the ecommerce site).

Link to comment
Share on other sites

Umm...good question. You might see arguments suggesting PDO is more secure than MySQLI, but I'm not convinced of that. Using bound parameters is more secure than not, regardless of the interface.

 

You'll also see arguments suggesting PDO is "better" than MySQLI. I wouldn't make that argument myself, but I wouldn't think it a mistake to choose PDO over MySQLI. PDO gives you a non-database-specific way to interact with the database but at the cost of losing some database-specific benefits. And, in my experience, the number of times an application is moved from one database backend to another is small. If I were starting a new project today, I could go either way. If I were starting a new project today designed to work with multiple database backends, then I'd definitely use PDO. 

 

You got it working and you learned a few things and you're happy with the end result, so it sounds like it was worth your time!

Link to comment
Share on other sites

  • 2 weeks later...
 Share

×
×
  • Create New...