Hooked up the script to the database