Which two PHP modules provide APIs for developing MYSQL applications?

Which two PHP modules provide APIs for developing MYSQL applications?

Which two PHP modules provide APIs for developing MYSQL applications?

A.
Mysqli

B.
Mysqlnd

C.
PDO

D.
PDO_mysql

Explanation:
Reference:
http://www.oracle.com/technetwork/systems/articles/mysql-php3-140148.html



Leave a Reply 10

Your email address will not be published. Required fields are marked *


swdx

swdx

It’s A and D.

From the link Vince posted:

“This series of tutorials shows the essential steps involved in installing PHP with MySQL extensions mysql, mysqli, and pdo_mysql[…]”

Jay

Jay

C looks right. It asks for an API and it says PDO_MySQL is a driver for the PDO API.

https://dev.mysql.com/doc/connectors/en/apis-php-mysqli.overview.html

“What is PDO?

PHP Data Objects, or PDO, is a database abstraction layer specifically for PHP applications. PDO provides a consistent API for your PHP application regardless of the type of database server your application will connect to. In theory, if you are using the PDO API,”

https://dev.mysql.com/doc/connectors/en/apis-php-pdo-mysql.html

“PDO_MYSQL is a driver that implements the PHP Data Objects (PDO) interface to enable access from PHP to MySQL 3.x, 4.x and 5.x databases.”

Jay

Jay

After searching around this is still up in the air. I have no idea if it is C or D!!! I think the biggest clue is developing applications, which seems like PDO_mysql is used for.

https://dev.mysql.com/doc/apis-php/en/apis-php-mysqlinfo.api.choosing.html

PHP offers three different APIs to connect to MySQL. Below we show the APIs provided by the mysql, mysqli, and PDO extensions.

Recommended API:
It is recommended to use either the mysqli or PDO_MySQL extensions.

Feature comparison:
ext/mysqli PDO_MySQL ext/mysql

https://dev.mysql.com/doc/apis-php/en/apis-php-introduction.html

Chapter 4, MySQL Functions (PDO_MYSQL): Not its own API, but instead it’s a MySQL driver for the PHP database abstraction layer PDO (PHP Data Objects). The PDO MySQL driver sits in the layer below PDO itself, and provides MySQL-specific functionality. This extension is available as of PHP 5.1.0.

Jay

Jay

Okay my final answer is A and C.

PDO has multiple options for drivers so the PDO_MySQL is nothing special.

https://dev.mysql.com/doc/connectors/en/apis-php-mysqli.overview.html

There are three main API options when considering connecting to a MySQL database server:

PHP’s MySQL Extension

PHP’s mysqli Extension

PHP Data Objects (PDO)

The PDO MySQL driver extension, for example, does not expose an API to the PHP programmer, but provides an interface to the PDO layer above it.

The terms API and extension should not be taken to mean the same thing, as an extension may not necessarily expose an API to the programmer.

What is the PDO MYSQL driver?

The PDO MYSQL driver is not an API as such, at least from the PHP programmer’s perspective.
The PDO MYSQL driver is one of several available PDO drivers.

Ray

Ray

A and C are correct.

rain

rain

There are three main API options when considering connecting to a MySQL database server:

PHP’s MySQL Extension

PHP’s mysqli Extension

PHP Data Objects (PDO)