<<< Previous question <<< Question ID#0243.md >>> Next question >>>
You have been given the following code snippet:
$stmt = $dbh->prepare("SELECT * FROM USER where name = ?");
if ($stmt->execute(array($_GET['name']))) {
while (??????) {
print_r($row);
}
}
What will you write at line number 4 to fetch data from database?
- A)
$row = $stmt->fetch()
- B)
$row = $stmt->fetchall()
- C)
$row = $stmt->getch()
- D)
$row = $stmt->get()
Answer
Answer: A