I'm trying to write code for retrieving information from my database and in there I'm using a function that I'm writing myself to retrieve out exactly what I want. In this function I should be able to refer to a variable that is the name of something to do with my database and have it know what I'm talking about, right?
If you've declared your connection to the database as global, then I'm sure your function will recognize that connection. If not, then you can just pass it to your function's parameter.