New method for inserting data into mysql.