Long-Time PHP / MySQL logging and Plotting Tool - The Backend