replace mysql with queryDB() and replace other mysql_ with at_ functions