menu

PHP Database Connection

PHP Database Connection - Important Points


16. Which of the following functions is used to retrieve the error message associated with the most recent database operation in PHP?

A. mysql_error()

B. mysqli_error()

C. pdo_error()

D. None of the above

Discuss Work Space

Answer: option b

Explanation:

mysqli_error() function is used to retrieve the error message associated with the most recent database operation in PHP.

17. Which of the following functions is used to check if a database connection is still active in PHP?

A. mysql_ping()

B. mysqli_ping()

C. pdo_ping()

D. None of the above

Discuss Work Space

Answer: option b

Explanation:

mysqli_ping() function is used to check if a database connection is still active in PHP.

18. Which of the following functions is used to set the character set for the database connection in PHP?

A. pdo_set_charset()

B. mysql_set_charset()

C. mysqli_set_charset()

D. None of the above

Discuss Work Space

Answer: option c

Explanation:

mysqli_set_charset() function is used to set the character set for the database connection in PHP.

19. Which of the following functions is used to retrieve the current character set for the database connection in PHP?

A. mysqli_character_set_name()

B. mysql_character_set_name()

C. pdo_character_set_name()

D. None of the above

Discuss Work Space

Answer: option a

Explanation:

mysqli_character_set_name() function is used to retrieve the current character set for the database connection in PHP.

20. Which of the following functions is used to free up memory associated with a result set in PHP?

A. pdo_free_result()

B. mysql_free_result()

C. mysqli_free_result()

D. None of the above

Discuss Work Space

Answer: option c

Explanation:

mysqli_free_result() function is used to free up memory associated with a result set in PHP.


Subscribe for Latest Career Trends
Subscribe Now
Use AI and ChatGPT for Career Guidance

Unlock Your Future

Join Now
Worried for Placements in 2024?

Join FAST TRACK Course

Join Now
Supercharge Your SUCCESS

Join All in One Placement Mock Tests-2024

Join Now