> there is only one query and only one result set My bad, I missed that. Hmm... Well... I dunno. You could quit being so stinking optimized and break your single query into two queries. :) But one of the resident PHP gurus should be piping up soon with an answer. -jeremy