Bring PHP outside variables to PHP class?

Well, the user can’t overwrite the GLOBALS, but other developers could in other areas of the codebase, which is why globals are generally frowned upon. You could/should just do the SQL query inside the class itself, rather than outside and pulling it in.

Also, ditto on what everyone said about upgrading to mysqli.