Skip to content
Advertisement

Fatal error stating “Call to a member function bind_param() on a non-object”

I’ve gotten a fatal error, which I do not know where went wrong.

My Category page,

and this is my function script for getCategoryArrCon

Advertisement

Answer

If you have noticed, when you echo your prepared statement, it will look just like this:

That simple space is important also in the middle of c.image and FROM to make the query valid.

Or why not just make it a one liner:

And also make sure that $stmt->excute(); isn’t really a typo. Its ->execute()

Sidenote: Also, make use of ->error to check whether the preparation is okay. Example:

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