I want to open table 2 inside table1. See $sql2 below. I know this is illegal. How can I work around this? Or can I? Lost cause? John
$myconnection = mysql_connect($server,$user,$pass); #mysql_select_db($db,$myconnection); #not necessary $sql1 = 'select * from '.$db.'.'.$table.' order by district,number asc'; $myconnection2 = mysql_connect($server,$user,$pass); #mysql_select_db($db2,$myconnection2); #not necessary $news = mysql_query($sql1); //desc => z-a while ($mydata1 = mysql_fetch_object($news)) { echo "$mydata1->district<br />$mydata1->meeting<br />$mydata1->time<br />\n"; $sql2 = 'select participant,biography,district from '.$db.'.'.$table2.' where district=$mydata1->district'; $news2 = mysql_query($sql2); //desc => z-a while ($mydata2 = mysql_fetch_object($news2)) { echo "<li>$mydata2->participant</li>\n"; echo "<li>$mydata2->biography</li>\n"; } } mysql_close($myconnection); mysql_close($myconnection2); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php