943,175 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 114
  • PHP RSS
Aug 31st, 2010
0

Is it safe to use mysqli connection as global?

Expand Post »
I use a couple of functions to which I have to pass the name of the mysqli connection in order to fetch some data.
Is it safe to use a global variable for the mysqli connection to skip passing the connection name to the functions?
Similar Threads
Reputation Points: 10
Solved Threads: 0
Light Poster
arthurav is offline Offline
38 posts
since Jun 2010
Sep 1st, 2010
0
Re: Is it safe to use mysqli connection as global?
anybody?
Reputation Points: 10
Solved Threads: 0
Light Poster
arthurav is offline Offline
38 posts
since Jun 2010
Sep 1st, 2010
0
Re: Is it safe to use mysqli connection as global?
Sure it is. As long as you don't have any includes or extensions that could access this global. My guess would be that you won't be including and malicious scripts on your site intentionally, so with the details you gave, I would say you're safe!
-PhpMyCoder
Reputation Points: 47
Solved Threads: 47
Posting Whiz
FlashCreations is offline Offline
393 posts
since Sep 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: How can I store Profile Picture in MySQL Database
Next Thread in PHP Forum Timeline: How to take values from the DB to a combo box





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC