What is the common error message related to SQL syntax when using PHP for database INSERT operations?

When performing database INSERT operations in PHP, a common error message related to SQL syntax is "syntax error near 'VALUES'." This error typically occurs when there is a mistake in the SQL query syntax, such as missing quotes around values or incorrect column names. To solve this issue, ensure that the SQL query is properly formatted with the correct column names and values enclosed in quotes.

// Example of a correct SQL INSERT query in PHP
$sql = "INSERT INTO table_name (column1, column2) VALUES ('value1', 'value2')";
$result = mysqli_query($connection, $sql);

if ($result) {
    echo "Record inserted successfully";
} else {
    echo "Error: " . $sql . "<br>" . mysqli_error($connection);
}