Adding global $mysqli
inside the function will work pretty in this case. If it does not work, you are doing a mistake somewhere in your function or in the query(may be).
function function_name_here($arguement_variable_here)
{
global $mysqli;
$mysqli->query($query);
}
And make sure, you include the dependency file - common.php before the function definition. If the include/require is done below the function(s) definition, probably that may not work in some cases.