4 replies
Both solutions are good. MySqli can only use MySql. PDO can use 12 different databases. PDO seems to be more object oriented while MySqli seems more procedural. Both have prepared statements. What do you prefer?
#mysqli #pdo
  • Profile picture of the author Andrew H
    Signature
    "You shouldn't come here and set yourself up as the resident wizard of oz."
    {{ DiscussionBoard.errors[8304759].message }}
  • Profile picture of the author SteveSRS
    PDO for me too.. your statement about object oriented / procedural isn't right btw. Mysqli supports both and PDO is a wrapper and thus only object oriented.
    {{ DiscussionBoard.errors[8306298].message }}
  • Profile picture of the author wayfarer
    I've never been crazy about PDO, but it's about as good as it comes as far as an ORM for PHP. As long as you get past the learning curve, it's a pretty safe bet, even if you don't need to switch database engines. I've usually used mysqli or mysql extensions, which are built in, mostly just because I've done a bunch of PHP deployments on simple shared servers that don't even have PDO. So in all honesty, if you're doing a lot of PHP, it's good to know both.

    When I have complete control over my server environment, and am doing a larger deployment, I don't even use PHP any more. There are much better ORMs for Python, at least in my experience. Mostly I use the Django ORM, but am learning SQLAlchemy also.
    Signature
    I build web things, server things. I help build the startup Veenome. | Remote Programming Jobs
    {{ DiscussionBoard.errors[8309399].message }}
  • Profile picture of the author kiash001
    PDO is the best!
    {{ DiscussionBoard.errors[8325580].message }}

Trending Topics