Is bind_param not allowed in a function()?
When I replace the ? with hardcoded numbers the code works.