# Example: Prepare Statement with `PDO_MySQL` and Named Placeholders
```
    $sqlStmt = "INSERT INTO t_php (name, buffered_by_default)"
      . " VALUES"
      . " ~!@(:name, :bbd)@!~";
    $stmt = ~!@$dbHandle->prepare@!~($sqlStmt);

    ~!@$stmt->bindParam@!~(':name', $name);
    ~!@$stmt->bindParam@!~(':bbd', $bbd);

    $name = "mysqli";
    $bbd = "Y";
    ~!@$stmt->execute()@!~;

    $name = "PDO_MySQL";
    $bbd = "N";
    ~!@$stmt->execute()@!~;

    ~!@$stmt->closeCursor()@!~;
```
----------------------------------------------------------------
The example in the slide inserts new records into the `t_php` table.

The program creates a SQL statement string identified by $sqlStmt, with two named placeholders for the insert values.

The program prepares a statement from the provided SQL string by calling the `PDO` object’s `prepare()` method.

Then, the program calls the statement object’s `bindParam()` method to bind variables to the named parameters. And, the program assigns values to the variables bound to the statement.

For execution, `execute()` method is called to execute the prepared statement with the values assigned to it.

Then, the program changes the values for two variables, and execute the prepared statement again.

Last, the program closes the statement object, deallocating the prepared statement to release resources.
