PHP query and interface completed, currently untested