If you are like me you often grab some old code and copy it and then just change the values a bit.
I find myself more often than not googling the code on StackOverflow in order to get some examples because I am too lazy to type it out.
Here is the code I use for PDO inserts in PHP
$stmt = $pdo->prepare('INSERT INTO table_name (column_name, column_name, column_name) VALUES (:column_name, :column_name, :column_name)');$stmt->bindParam(':column_name', $column_name);$stmt->bindParam(':column_name', $column_name);$stmt->bindParam(':column_name', $column_name);$stmt->execute();
OR if you use the POSTed variables directly instead.
$stmt = $pdo->prepare('INSERT INTO table_name (column_name, column_name, column_name) VALUES (:column_name, :column_name, :column_name)');$stmt->bindParam(':column_name', $_POST['column_name']);$stmt->bindParam(':column_name', $_POST['column_name']);$stmt->bindParam(':column_name', $_POST['column_name']);$stmt->execute();
I really hope this boilerplate code is useful to you.
Let me know if you need any other quick-grab examples.