menu

PHP Database Connection

PHP Database Connection - Important Points


6. Which of the following functions is used to fetch a row from a result set in PHP?

A. mysqli_get_row()

B. mysql_fetch_row()

C. pdo_fetch_row()

D. mysqli_fetch_row()

Discuss Work Space

Answer: option d

Explanation:

mysqli_fetch_row() function is used to fetch a row from a result set in PHP.

7. Which of the following functions is used to fetch an associative array from a result set in PHP?

A. mysqli_fetch_assoc()

B. mysql_fetch_assoc()

C. pdo_fetch_assoc()

D. None of the above

Discuss Work Space

Answer: option a

Explanation:

mysqli_fetch_assoc() function is used to fetch an associative array from a result set in PHP.

8. Which of the following functions is used to fetch a row as an object from a result set in PHP?

A. mysqli_get_object()

B. mysql_fetch_object()

C. pdo_fetch_object()

D. mysqli_fetch_object()

Discuss Work Space

Answer: option d

Explanation:

mysqli_fetch_object() function is used to fetch a row as an object from a result set in PHP.

9. Which of the following functions is used to return the number of rows in a result set in PHP?

A. mysqli_num_rows()

B. mysql_num_rows()

C. pdo_num_rows()

D. None of the above

Discuss Work Space

Answer: option a

Explanation:

mysqli_num_rows() function is used to return the number of rows in a result set in PHP.

10. Which of the following functions is used to return the ID of the last inserted row in a table in PHP?

A. mysqli_insert_id()

B. mysql_insert_id()

C. pdo_insert_id()

D. None of the above

Discuss Work Space

Answer: option a

Explanation:

mysqli_insert_id() function is used to return the ID of the last inserted row in a table 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