About the first problem I think you need to give us more data ! As for the seccond... I haven't seeeeen such loops yet...
But you can go arround them and do something like: SELECT * FROM db WHERE (id BETWEEN 5 AND 50) AND id%5=0 -- Gabriel PREDA Senior Web Developer