I have table match (which contains "id, date, team1_id, team2_id")
and table team (which contains "id, name")
I need PHP or SQL code that will show name of team(from table team) WHERE "team1_id"
and team2_id" = team.id
...actually I have something like this:
$deleteMatch = Database::query('SELECT match.id, match.team1_id, match.date,
team.id, team.name FROM `match`, `team` WHERE team.id = match.team1_id');
foreach($deleteMatch as $matchinfo)
{
?><option value="<?php echo $matchinfo["id"];?>">
<?php echo $matchinfo["date"]; echo $matchinfo["name"];?></option>
<?php
}
but I need add team2.id(name)
to the foreach. ( DATE | TEAM1 NAME | TEAM2 NAME )
Hope you understood me. Thanks for help.