Your query has an unmatching set of values for the query,sometimes it could be a field like an id or uid. Here is an example.
$query = "INSERT INTO table (id, first_name, last_name)
VALUES('','$_POST[first_name]','$_POST[last_name])";
That will work.
$query = "INSERT INTO table (first_name, last_name)
VALUES('','$_POST[first_name]','$_POST[last_name])";
This will not
$query = "INSERT INTO table (id, first_name, last_name)
VALUES('$_POST[first_name]','$_POST[last_name])";
Neither will this.
If you look close the second query doesn't work because there is an added value when all that was to be inserted into the table was two values and there are three. The third query won't work because you are wanting to insert 3 values but there are ony two the first name and the last name but not an id. Does that help