My query:
$name = $vm_product->product_name;
$columns = array('cart_id', 'product_id', 'quantity', 'price', 'name');
$values = array($cart_id, $product_id, $quantity, $price, $name);
$query
->insert($db->quoteName('#__products'))
->columns($db->quoteName($columns))
->values(implode(',', $values));
$db->setQuery($query);
$db->execute();
If $name is numbers only, as example $name = 100, then everything is OK.
But if $name is a string, as an example $name = "Cable", an error is thrown:
1054 - Unknown column 'Cable' in 'field list'
Why #1054? "Cable" is not a column!