PHP scripts performing database operations when invoked by app