Ok, yes, thanks that works when there's only one set of data per query.
But now - is where the loop problem gets weir for me. If you look at the code below, I need to get and email potentially several reviews per submission id....
$sql="SELECT *
FROM submissions";
//Initial Submission Query
$submissions = mysql_query($sql, $connection);
confirm_query($submissions);
while($sub = mysql_fetch_array($submissions)) {
//email stuff and headers... got this working...
$sql2="Select * FROM data08_re WHERE sub_id=" .$sub['sub_id']. " ";
$data_re_set = mysql_query($sql2, $connection);
confirm_query($data_re_set);
while($data_re=mysql_fetch_array($data_re_set)) {
//begin review
$output = "Review ID: {$data_re["re_id"]}\n";
$output .= "Problem Statement: {$data_re["problem"]}\n";
$output .= "Strength of Research Design: {$data_re["strength"]}\n";
$output .= "Data Collection: {$data_re["data"]}\n";
$output .= "Results: {$data_re["results"]}\n";
$output .= "Conclusion: {$data_re["conclusion"]}\n";
$output .= "Comments:{$data_re["comments"]}\n";
}
//now do the mail funciton....
mail($email,
"blah blah blah blah :::: Below are two or three reviews....
$output",
$headers);
}
This works when I'm echoing to webpage - but yes, the output variable will always be overwritten by the last review to pass through right??? hmmmm....