Your query needs an additional where clause to filer on the VisitorID column.
You how are you determining which user is being queried?
Are you passing a querystring value with the VisitorID?
Is this a logged in user where there is a session variable to filter on?
If you are using security assist, there will be a session variable set that contains the logged in users Primary Key, it will probably be named VisitorID. You could modify your SQL To filter the visitor ID column on the session variable:
$query = "SELECT visitors.VisitorGroupID, groups.GroupName ".
"FROM visitors, groups ".
"WHERE visitors.VisitorGroupID = groups.GroupID AND visitors.visitorID = ". isset($_SESSION['visitorID'])?$_SESSION['visitorID']:"-1";