I have a huge join that brings together six tables and works perfectly for grabbing single results, but I'm trying to expand it and solve an issue to avoid nesting it inside of a second query.
For the sake of making it simple let's basically say that what I'm trying to do is this:
$sql = mysql_query("SELECT value1 FROM Table");
while ($row = mysql_fetch_array($sql)) {
$value1 = ($row["value1"]);
$sql2 = mysql_query("SELECT new1, new2, new3 FROM Table2 WHERE id = \"$value1\"");
// rest of query stuff here
}
I did something similar a while back but I can't find my notes to see how I solved this and was hoping this was something someone here might now a solution for.