added at_ functions to replace mysql_ fucntions