Te dejo la url del manual PHP y un código de muestra que uso en una de mis apps.
PHP: PDO
Código php:
Ver original...
$stmt = $link->prepare("INSERT INTO administrators(id, username, password, email, phone, type)
VALUES (:id, :username, :password, :email, :phone, :type)");
$stmt->bindParam(':id', $new_id);
$stmt->bindParam(':username', $p_admin->getUsername());
$stmt->bindParam(':password', $p_admin->getPassword());
$stmt->bindParam(':email', $p_admin->getEmail());
$stmt->bindParam(':phone', $p_admin->getPhone());
$stmt->bindParam(':type', $p_admin->getType());
try{
$stmt->execute();
}
catch(PDOException $e){
throw new Exception($e->getMessage());
}
...