Separating queries from PHP, including interface for hasSQL