started the code to put together the sql insert command for data logging