Added the php pulling functionality from db