<<< Previous question <<< Question ID#0629.md >>> Next question >>>
Consider the following code snippet:
$query = "SELECT first, last, phone
FROM contacts
WHERE first LIKE 'John%'";
$statement = mysqli_prepare($link, $query);
mysqli_execute($statement);
/* ???? */
while (($result = mysqli_stmt_fetch($statement))) {
print "Name: $first $last\n";
print "Phone: $phone\n\n";
}
Assuming this code snippet is part of a larger correct application, what must be done in place of the ???? above for the correct output to be displayed?
- A) A while loop, fetching the row and assigning $first, $last, and $phone the proper value
- B) None of the above
- C) mysqli_fetch_columns($first, $last, $phone);
- D) mysqli_stmt_bind_result($statement, $first, $last, $phone);
Answer
Answer: A