# First, the simple stuff...

- ## After calling prepare() on a statement with placeholders:

  $sth = $dbh->prepare(“select * from table where k1=? and k2=?”);

- ## Values need to be assigned (‘bound’) to each placeholder before the database can execute the statement

- ## Either at execute, for simple cases:

  $sth->execute($p1, $p2);

- ## or before execute:

  $sth->bind_param(1, $p1);
  $sth->bind_param(2, $p2);
  $sth->execute;

Previous slide | Next slide | Back to first slide | View graphic version