Which of the following prepared query strings is used to execute a prepared statement?
PDOStatement::execute
Correct:
PDOStatement::execute
Answer: C
PDOStatement::execute is used to execute a prepared statement. PDO is a PHP extension for establishing PHP's database connections by creating a uniform interface. PDO is used to create code which is portable across many databases and platforms.
Answer option D is incorrect. PDOStatement::errorInfo is used to fetch extended error information associated with the last operation on the statement handle.
Answer option B is incorrect. PDOStatement::fetch is used to fetch the next row from a result set.
Answer option A is incorrect. PDOStatement::fetchAll returns an array containing all of the result set rows.