Help for this page

Select Code to Download


  1. or download this
      $name = "O'Reilly";
      $sth = $db->prepare("SELECT * FROM emp WHERE name = '$name'");
      $sth->execute();
    
  2. or download this
      $name = "O'Reilly";
      $sth = $db->prepare("SELECT * FROM emp WHERE name = ?");
      $sth->execute($name);
    
  3. or download this
      my $field = $old ? "olddata" : "newdata";
      $sth = $db->prepare("SELECT * FROM ?");
      $sth->execute($field);