added getorders to sql