Segue 34 exemplos de utilização com prepare statment através do objeto PDO:
<?php
/* Example one: Execute a prepared statement with placeholder */
$sql = 'INSERT INTO tabela (cod, nome, email) VALUES (:codigo, :nome, :email)';
$sth = $dbh->prepare($sql);
$sth->execute(array(':codigo' => (int) 128,
':nome' => 'ndroid',
':email' => '[email protected]'));
/* Example two: Execute a prepared statement with bind param method */
$sql = 'INSERT INTO tabela (cod, nome, email) VALUES (:codigo, :nome, :email)';
$valor1 = '128';
$valor2 = 'ndroid';
$valor3 = '[email protected]';
$sth = $dbh->prepare($sql);
$sth->bindParam(":codigo", $valor1, PDO::PARAM_INT);
$sth->bindParam(":nome", $valor2, PDO::PARAM_STR);
$sth->bindParam(":email", $valor3, PDO::PARAM_STR);
$sth->execute();
/* Example three: Execute a prepared statement with bind value method */
$sql = 'INSERT INTO tabela (cod, nome, email) VALUES (:codigo, :nome, :email)';
$sth = $dbh->prepare($sql);
$sth->bindValue(":codigo", (int) 128, PDO::PARAM_INT);
$sth->bindValue(":nome", 'ndroid', PDO::PARAM_STR);
$sth->bindValue(":email", '[email protected]', PDO::PARAM_STR);
$sth->execute();
/* Example four: Execute a prepared statement with sequence */
$sql = 'INSERT INTO tabela (cod, nome, email) VALUES (?, ?, ?)';
$sth = $dbh->prepare($sql);
$sth->execute(array((int) 128,
'ndroid',
'[email protected]'));
?>