more code tidying: sql_start()