nerdexam
CIW

1D0-437 · Question #76

Which of the following code segments correctly readies a database query, creating a valid statement handle and a result set? Assume $dbh represents a valid database handle.

The correct answer is B. $sth = $dbh->prepare(SELECT * FROM aTable). See the full explanation below for the reasoning.

Question

Which of the following code segments correctly readies a database query, creating a valid statement handle and a result set? Assume $dbh represents a valid database handle.

Options

  • A$sth = $dbh->prep_statement(SELECT * FROM aTable); $sth->execute_statement;
  • B$sth = $dbh->prepare(SELECT * FROM aTable);
  • C$sth = $dbh->prep_statement(SELECT * FROM aTable); $sth->execute;
  • D$sth = $dbh->prepare_statement(SELECT * FROM aTable); $sth->execute_statement;

How the community answered

(25 responses)
  • A
    12% (3)
  • B
    80% (20)
  • C
    4% (1)
  • D
    4% (1)

Community Discussion

No community discussion yet for this question.

Full 1D0-437 Practice