Well, I have this function in a custom script for SMF:
$query = \"SELECT id_member, real_name, id_group FROM smf_members WHERE id_group > 0 AND id_group != 9
you function only makes a variable $queryDisplay (that is traped within the scope of the function)