12

I have spent 2 hours fighting with another dev once about mysqli vs pdo and how mysqli is probably worse than pdo, turns out the only difference is that pdo supports more databases, where as mysqli only supports mysql, else their spec is basically the same. 😰

Comments
  • 2
    Except that mysqli supports a few special operations specific to mysql/mariadb, which cannot be handled by pdo. Same for pdo_pgsql and pgsql for PostgreSQL
  • 1
    @Artemix TIL, never faced a method that was only specific to mysqli yet thankfully
  • 4
    Yeah PDO is great but I'm pretty sure, if I remember correctly, which I probably don't, that PHP.net recommends you use msqli. Or maybe I'm getting things mixed up with something I read on msdn about something entirely different. I probably am actually. I'm certain of it now. Hmm, did I just make my comment redundant? Should I post it? :/
  • 3
    Idk I have always heard PDO is de facto and don't use the other shiznit/ But idk why...never really looked into it, just followed the crowd like the good little sheep I am.
  • 2
    @rEaL-jAsE when in doubt, always post
    @Bitwise I used mysqli and secure mysql functions back when it was time to switch to bind params standards, but pretty quickly switched to pdo
  • 2
    @rEaL-jAsE I always thought PDO was the standard for accessing databases in PHP, though I had no idea that mysqli was so similar to PDO lol, so you probably shouldn’t believe me either 🀷‍♂️
Your Job Suck?
Get a Better Job
Add Comment