added exception to mysql query failure, changed update function to include querybuilder