MVC connection, which one to use Msqli or PDO?

Asked

Viewed 221 times

0

I’m starting to program a PHP MVC, which type of connection is most recommended: Msqli or PDO and why?

  • 7

    There is no relationship between one thing and another. There is no better. There are tastes and eventually what best suits a specific problem. Mysqli should always be the first option, there is hardly need to use PDO. Some people disagree with this, I don’t know why (I’ve heard many explanations, but they don’t usually convince me, even if there is a reason in very specific cases, only that the staff abuses), so this is a matter of opinion and can not provide a definitive answer.

  • 1

    Read the second most voted answer of the duplicate question, she is the best there.

1 answer

0

PDO supports 12 different database drivers and named parameters, loses performance compared to Mysqli.

I recommend the PDO using the Doctrine, for flexibility with drives and compatibility;

Reference

  • 2

    Mysqli will be removed from php? Where is the source of this statement?

  • In PHP 7, the mysql_* functions (such as mysql_connect(), mysql_query() and others) no longer exist. Now you need to use Mysqli or PDO. You said something there’s no man...

  • 2

    Corrected, thank you very much, had me confused;

Browser other questions tagged

You are not signed in. Login or sign up in order to post.