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

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.

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.

A.
$sth = $dbh->prep_statement(SELECT * FROM aTable);
$sth->execute_statement;

B.
$sth = $dbh->prepare(SELECT * FROM aTable);
$sth->execute;

C.
$sth = $dbh->prep_statement(SELECT * FROM aTable);
$sth->execute;

D.
$sth = $dbh->prepare_statement(SELECT * FROM aTable);
$sth->execute_statement;

Explanation:

[Note] Only have method “$ dbh -> prepare( …)”,
$ dbh -> prep_ statement ( …) is not existed



Leave a Reply 0

Your email address will not be published. Required fields are marked *