I get an error that says
Fatal error: Call to undefined method stdClass::mysql_con() in ........../.../includes/script/import.php on line 68.
Line 68 corresponds to:
if(!$ip2c->mysql_con())
I do have a require_once()
statement at the beginning of my script
What could be the problem here?
Thanks
Dusoft says it could mean:
$ip2c
object does not exist,
Which is not correct because you would get a different error "Fatal error: Call to a member function mysql_con() on a non-object
"
He also says it could mean:
mysql_con
function is not part of the class you are trying to call
Which is true but not so helpful cos its very difficult to add methods to stdClass
.
Additionally it could be to do with serialisation quote:
Or most likely, I think:
the $ip2c
variable was not an object and then php silently cast it to become stdClass somewhere in the code above.
This could happen if you directly assign a property on it.
Like:
$ip2c = null;
//php casts $ip2c to 'stdClass'
$ip2c->foo = bah;
//Fatal error: Call to undefined method stdClass::mysql_con() in...
$ip2c->mysql_con();
See a better example here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With