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?
arthurav
0
Light Poster
Recommended Answers
Jump to PostSure 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
All 2 Replies
Reply to this topic
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.