Parameter Passing
previous slidetable of contentsnext slide

$pc = '123-4567-00';

$sth->prepare("SELECT * FROM PRODUCTS WHERE PROD_CODE = '$pc'")
$sth->execute();

or

$sth->prepare("SELECT * FROM PRODUCTS WHERE PROD_CODE = ?")
$sth->execute($pc);
Multiple executions
Automatic quoting
Safer than string interpolation