Skip to content
Advertisement

PHP Prepared statement bind_param() error

Many people on stackoverflow has had this problem, but i still cannot spot the mistake

This is the error:

This is the lines of code:

Advertisement

Answer

After every mysqli or PDO function that COULD return a bad/failed status you must test for that possibility.

The error Fatal error: Call to a member function bind_param() on boolean says it all. $insertpost is false so the prepare failed for SOME reason, it could be a bad query or it could be that the MYSQL Server has crashed and cannot prepare the statement.

So you must code accordingly

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement