fix deprecated mysql function