Made sqldata.php more modular