added mysql function