I am trying to retrieve from 1 database the specific names of teams (no problem).
Then, what i want to do is for each of the team names, pull info from another mysql database where the details match the team name.
How can i do this?
I have tried...
$sql1 = "SELECT * FROM $team_table";
$result1 = mysql_query($sql1);
while ($team_data = mysql_fetch_array($result1))
{
$id = $team_data["id"];
$name = $team_data["name"];
$sql2 = "SELECT * FROM table2 WHERE team_name = '$name'";
$result2 = mysql_query($sql2);
while ($query_data = mysql_fetch_array($result2))
{
$client = $query_data["client"];
etc...
echo "etc etc etc";
}
}
All i get is 1 row output not all the info I want.
Any ideas?