Fatal error: Call to a member function real_escape_string() on a non-object in

This is a general question about php mysql mysqli

Fatal error: Call to a member function real_escape_string() on a non-object in

This works on my desktop computer but not godaddy shared linux
I know, I do not like godaddy either but have to use for this project.


what should I tell them to enable in php
LVL 1
rgb192Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Dave BaldwinFixer of ProblemsCommented:
"real_escape_string()" works fine in both the 'mysql' and 'mysqli' drivers on Godaddy.  You need to be more specific about the problem you are having.  If either of those drivers are enabled (which they normally are), then the 'real_escape_string()' function is also enabled.
0
Loganathan NatarajanLAMP DeveloperCommented:
Can you post your full code? Because, this function may be refereed in your MySQLi class and will affect..
0
Loganathan NatarajanLAMP DeveloperCommented:
0
Ray PaseurCommented:
Fatal error: Call to a member function real_escape_string() on a non-object
This message is thrown by PHP when the OOP method-call notation is used and the 'XYZ' is not an object.  Often this happens when object instantiation was omitted or failed, or XYZ was unset or cast to a non-object variable.

$x = $XYZ->real_escape_string();

It could just as easily be a member function foo() with this...

$x = $XYZ->foo();
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
rgb192Author Commented:
Thanks

this explanation let me know best

This message is thrown by PHP when the OOP method-call notation is used and the 'XYZ' is not an object.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.