Moin,
suche jemanden der gut SQL kann! Könnte mir jemanden helfen folgende SQL Abfragen zusmamen zufassen mit Inner JOINS ?
Code
$sql_team_set = "SELECT team_id FROM BM_MIG.team_sets_teams WHERE team_set_id = '".$row_emails['team_set_id']."'";
$result_team_set = $GLOBALS['db']->query($sql_team_set);
while ($row_team_set = $GLOBALS['db']->fetchByAssoc($result_team_set)) {
$sql_team_name_sets = "SELECT name FROM BM_MIG.teams WHERE id = '".$row_team_set['team_id']."'";
$team_name_sets = $GLOBALS['db']->getOne($sql_team_name_sets);
$sql_team_id_sets = "SELECT id FROM teams WHERE name = '".$team_name_sets."'";