i probably not guess what is the issue with you and your code but i wanna suggest you to use alternet syntax this make more sense writing very long query.
"INSERT INTO table_name SET
column_name = $value,
column_name = $value,
column_name = $value,
column_name = $value,
column_name = $value,
column_name = $value";
solved Accessing MySQL using php it give error Query Field my code like that