DisplayRealNames: get MaxRows count
SELECT DISTINCT COUNT(*) AS cnt FROM realnames A,titlenames T WHERE A.showname = T.showname AND titlename='Saint John's University' AND hiphop=8 AND titlekind LIKE 'team'
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 's University' AND hiphop=8 AND titlekind LIKE 'team'' at line 1