I have two subsequent mysqli statements, and the second returns:
Fatal error: Call to a member function bind_param() on a non-object in ...
Something might have gone wrong with $db->prepare()
, check $db->error
.
Check the return value of mysqli::prepare. If it is FALSE, you should get the details for the occured error with mysqli::error.
I think your $stmt variable is null when you call bind_param over it. maybe your $_POST['vote'] is empty? you can check it before you bind the param on the command