I was looking at my post, and thought it might be easier to simplify the question.
I have one array built from a query, say like this...
$main = array('foo','bar','test','one');
I then do a foreach($main as $i) {
$sql = "select blah from blah where columna = '$i';
)
This is going to return...