Added an if statement to allow Dynamic_Query to alternatively use ground instead of Drupal db_query.