SQL query as fallback to auth script?