database is currently one way street, need a php script for fetching from database