PrepAway - Latest Free Exam Questions & Answers

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

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.

PrepAway - Latest Free Exam Questions & Answers

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