PHP trouble - Printable Version -Shoutbox (https://shoutbox.menthix.net) +-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58) +--- Forum: Skype & Technology (/forumdisplay.php?fid=9) +---- Forum: Tech Talk (/forumdisplay.php?fid=17) +----- Thread: PHP trouble (/showthread.php?tid=55738) PHP trouble by brian on 02-11-2006 at 09:33 PM
Never though I'd end up posting here, but i'm done. code: Then later on, I include another file, but I need the file to use my $sqlObj, but it is not able to access it for some reason. Never worked alot over classing systems, but no idea what to do here, maybe declare $sqlObj as public, but it's already outside any if's and else's. Thanks. RE: PHP trouble by J-Thread on 02-11-2006 at 11:02 PM
You are sure that it isn't declared within a function? Or do you try to use it in a function? code: Still doesn't work? Then you should look to the server setting. Does it work now? Then it's your code. Maybe you did define or use it within a function. Use "global $sqlObj;" then. RE: PHP trouble by rav0 on 02-12-2006 at 08:10 AM
Somebody posted something similar to this before. RE: PHP trouble by WDZ on 02-12-2006 at 08:30 AM
quote:That's nonsense. Or, at least, there's more to it than that. Quick test... file1.php code:file2.php code:Executing file1.php will echo the string as expected. |