You get that error if the number of columns specified (column count) isn't equal to the number of values specified (value count). You seem to have 2 columns and 2 values in this query, but since you show us code, and most likely not complete code, rather than the actually genereated sql query, it is impossible to say.
Do something like this
$query = "INSERT INTO....";
if (!$db->query)
error_log($query); // or echo
If the query fails to execute, you will see exactly the same query as was sent to the db, either on screen or in your error log.