What are common syntax errors to watch out for when using PHP for database insertions?

Common syntax errors to watch out for when using PHP for database insertions include missing semicolons at the end of lines, incorrect quotation marks around variables, and forgetting to concatenate strings properly. To avoid these errors, make sure to carefully check your syntax and use proper PHP string concatenation methods.

// Incorrect way of inserting data into a database
$query = "INSERT INTO users (name, email) VALUES ($_POST['name'], $_POST['email'])";

// Correct way of inserting data into a database
$query = "INSERT INTO users (name, email) VALUES ('" . $_POST['name'] . "', '" . $_POST['email'] . "')";