Hi,
As the error message suggests - you need to finish returning one set of values before you can get the new ones.
There are three ways around this
- you could loop through and put the initial results into an array or an object then perform the second query
- you could try to have two distinct connections to the same database and then query from the dissimilar ones
- you could just achieve this through sql and not have two queries at all.
I'd suggest here you could do, select id, name, dob from person where age = ?
I would always go for the sql solution if possible because it is easier to maintain, and should also be faster (and easier to spot logic mistakes)
Main Topics
Browse All Topics





by: RQuadlingPosted on 2007-06-13 at 02:09:35ID: 19272920
Why not just get the DOB as part of the first query? Then no need for a second query?