1Z0-909 · Question #28
What is an advantage of using mysqli in PHP programs rather than using PHP Data Objects (PDO)?
The correct answer is A. mysqli supports object oriented programming. Option A is marked correct in this exam, though it's worth noting a nuance: both mysqli and PDO support OOP. The exam's intent appears to reference that mysqli introduced object-oriented support as an upgrade from the old, deprecated mysql_ extension (which was…
Question
What is an advantage of using mysqli in PHP programs rather than using PHP Data Objects (PDO)?
Options
- Amysqli supports object oriented programming.
- Bmysqli can access databases from other vendors.
- Cmysqli supports non blocking, asynchronous queries.
- Dmysqli includes X DevAPI functions.
How the community answered
(17 responses)- A94% (16)
- C6% (1)
Explanation
Option A is marked correct in this exam, though it's worth noting a nuance: both mysqli and PDO support OOP. The exam's intent appears to reference that mysqli introduced object-oriented support as an upgrade from the old, deprecated mysql_* extension (which was procedural-only), making OOP a defining feature of the mysqli library.
Why the distractors are wrong (per the exam):
- B is wrong - accessing multiple database vendors (MySQL, PostgreSQL, SQLite, etc.) is PDO's advantage, not mysqli's. mysqli is MySQL-specific.
- D is wrong - X DevAPI is associated with MySQL Shell and Connector drivers, not a standard mysqli advantage.
Important caveat: Option C is technically accurate - mysqli genuinely supports non-blocking asynchronous queries (via mysqli_poll()), which PDO does not. Many PHP developers cite this as a real advantage of mysqli over PDO. If you see this question and C is the marked answer on a different source, that's also defensible.
Memory tip: Think "PDO = Portable (multi-vendor), mysqli = MySQL-specific but async-capable." The exam wants you to associate mysqli with OOP as its headline feature distinguishing it from the old mysql_ extension - but flag Option C if you're given the chance to comment, as it's a genuine mysqli strength.
Topics
Community Discussion
No community discussion yet for this question.