Added writing to MYSQL dB