//The variables are declared outside this function. I use `$_POST` to retrieve each user input in another .php file using html form tag. The variable `$db` is my database connection.

function insertintodb ($db, $avar, $bvar, $cvar)
{
/\*
How can I tell what values my variables are when using PDO bindParam? I output $avar to see its value in this function. How can I tell if PDO actually binded ":firstname" to $avar? Likewise with the other variables.
\*/

```
echo 'before <br>';
echo $avar;
echo '<br>';

    //firstname, midinitial, lastname are values in my database.
    //name is my table I am inserting into.
$insertname = "INSERT INTO name (firstname, midinitial, lastname) 
VALUES (:firstname, :midname, :lastname)";

echo 'before PDO prepare<br>';
echo $avar;
echo '<br>';

$stmt = $db->prepare($insertname);

$stmt->bindParam(':firstname', $avar);
$stmt->bindParam(':midname', $bvar);
$stmt->bindParam(':lastname', $cvar);

echo 'after binding variables using bindParam <br>';
echo $avar;
echo '<br>';

$stmt->execute();

echo 'after executing <br>';
echo $avar;
echo '<br>';

}

```