Skip to content

Latest commit

 

History

History
40 lines (33 loc) · 659 Bytes

0243.md

File metadata and controls

40 lines (33 loc) · 659 Bytes

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