hi, i am having trouble fetching results from the database. i have pasted my code below, i am running two queries - the first query ($record1) selects some contact info for each contact person and the second query ($erecord) selects all the emails for each contact group name(=dbservername).
$record1 = "select dbservername, name, work, emergency, email from Contact_DBServer order by dbservername";
$result1 = $db->query($record1);
while ($result1->fetchInto($array1))
{
$erecord= "select email from Contact_DBServer where dbservername='". $array1[0] ."'";
$eresult = $db->query($erecord);
$email_list = $eresult->fetchrow();
$string = implode('; ', $email_list);
echo " <td align=center><a href=\"mailto: ".$string."\">". $array1[0] ."</a></td>";
echo " <td align=center>" . $array1[1] . "</td>";
echo " <td align=center>" . $array1[2] . "</td>";
echo " <td align=center>" . $array1[3] . "</td>";
echo " <td align=center><a href='mailto:" . $array1[4] . "'>". $array1[4] ."</a></td>";
echo " </tr>";
}
what $string prints out is the FIRST email in the query result set, how can i make the code print out the entire list of emails (all the rows in the second query set) as ONE string?