PHP Fatal Error [FIX]: Call to a Member Function Fetch_Assoc On a Non-Object

I remember this annoying error like it was yesterday.

It always baffled me a bit when I first started learning PHP (I know… N00B!): Fatal error: call to a member function fetch_assoc() on a non-object.

It was always the line number that tripped me up.

Anyhoo, here’s what’s really going on and how to kill this error dead once and for all:

And, if you’d give me a likey-like I’d sure appreciate it!

And like I said the source code is available on Patreon for the smart folks who support the show. (You know you wanna join them.)

P.S. If you liked the show, give it a like and share with the communities and people you think will benefit. And, you can always find all my tutorials, podcast episodes and more on johnmorrisonline.com, @jpmorris on Twitter and youtube.com/johnmorrisvideo.

Subscribe to the Podcast


Originally published at John Morris.

Like what you read? Give John Morris a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.