Q
Which PHP extension provides procedural and object-oriented approaches for executing SQL queries and interacting with MySQL databases?

Answer & Solution

Answer: Option D
Solution:
MySQLi (MySQL Improved) extension in PHP provides both procedural and object-oriented approaches for executing SQL queries and interacting with MySQL databases. It offers features such as prepared statements and transaction support.
Related Questions on Average

Which of the following PHP functions is used to execute an SQL query in PDO extension?

A). pdo_execute()

B). pdo_query()

C). pdo_fetch()

D). pdo_prepare()

What is the primary advantage of using PDO extension over MySQLi for executing SQL queries in PHP?

A). Better performance

B). Improved security against SQL injection

C). Easier syntax

D). Compatibility with older PHP versions

What is the purpose of the mysqli_close() function in PHP?

A). Establishing a database connection

B). Executing SQL queries

C). Fetching data from the database

D). Closing the database connection

Which of the following PHP functions is used to get the number of rows affected by an SQL query in MySQLi extension?

A). mysqli_num_rows()

B). mysqli_affected_rows()

C). mysqli_num_fields()

D). mysqli_fetch_row()

Which of the following SQL operations is used to remove all data from a database table?

A). INSERT

B). SELECT

C). TRUNCATE

D). DELETE

What is the purpose of the mysqli_num_rows() function in PHP?

A). Establishing a database connection

B). Executing SQL queries

C). Fetching data from the database

D). Getting the number of rows in a result set

What is the purpose of the mysqli_fetch_object() function in PHP?

A). Establishing a database connection

B). Executing SQL queries

C). Fetching data from the database

D). Closing the database connection

What is the primary function of the mysqli_fetch_array() function in PHP?

A). Establishing a database connection

B). Executing SQL queries

C). Fetching data from the database

D). Closing the database connection

Which of the following SQL operations is used to update existing data in a database table?

A). INSERT

B). SELECT

C). UPDATE

D). DELETE

Which of the following PHP functions is used to execute an SQL query in MySQLi extension?

A). mysqli_execute()

B). mysqli_query()

C). mysqli_fetch()

D). mysqli_prepare()