Cleaned up after removing DBConf.php
Updated code to use new SQL functions