Stryves Posted July 7, 2009 Share Posted July 7, 2009 So let's say I run a query: <?php $query = "SELECT * FROM table"; $result = mysql_query($query) or die(mysql_error()); $array = mysql_fetch_array($result) or die(mysql_error()); ?> So now I would use $array['ID'] somewhere in my code... Isn't this a Global Variable considering it can be used almost anywhere? Quote Link to comment https://forums.phpfreaks.com/topic/165078-solved-is-this-a-global-variable/ Share on other sites More sharing options...
p2grace Posted July 7, 2009 Share Posted July 7, 2009 By definition it is not a global variable. It's access is limited to the scope of that script. Quote Link to comment https://forums.phpfreaks.com/topic/165078-solved-is-this-a-global-variable/#findComment-870480 Share on other sites More sharing options...
wildteen88 Posted July 7, 2009 Share Posted July 7, 2009 Reading the manual on Variable Scope will help you more. Quote Link to comment https://forums.phpfreaks.com/topic/165078-solved-is-this-a-global-variable/#findComment-870483 Share on other sites More sharing options...
Stryves Posted July 7, 2009 Author Share Posted July 7, 2009 Thank you Quote Link to comment https://forums.phpfreaks.com/topic/165078-solved-is-this-a-global-variable/#findComment-870491 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.