Added database functionality to population.php