Okay, try this as your query:
Code:
$db->query_write("
INSERT INTO " . TABLE_PREFIX . "bbcode
(bbcodetag, bbcodereplacement, bbcodeexample, bbcodeexplanation, twoparams, title, buttonimage, options)
VALUES
('fa', '<i class="fa %1\$s"></i>', '[fa]fa-male[/fa]', 'Use Font Awesome icons. For a list of available icons see here: https://fortawesome.github.io/Font-Awesome/icons/', 0, 'Font Awesome', '', 31)
");
build_bbcode_cache();
Note: I added a backslash before the dollar sign in the string representing the parameter of the BCode.