Calculate result and Input formula and result in mysql database