I've looked up and down here but couldn't find anything that works. I'm trying to join two tables and output team1id and team2id from the resulting table.

```
//Query
$sql = "SELECT match.*, matchrelations.match_id, matchrelations.poolname
        FROM match JOIN matchrelations
        ON match.id=matchrelations.match_id
        WHERE matchrelations.poolname='$poolname'";

//Debugging
if (!$check1_res) {
    printf("Error: %s\n", mysqli_error($link));
    exit();
}
//Query database
$result = mysqli_query($link,$sql);

//Echo
while($row = mysqli_fetch_assoc($result))
  {
  $team1 = $row['match.team1id'];
  $team2 = $row['match.team2id'];
  echo "$team1 VS $team2";
  echo "<br>";
}   

```

The error is being thrown in the sql statement, and produces error:

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '\*, matchrelations.match\_id, matchrelations.poolname FROM match JOIN matchrela' at line 1

I'm not sure what I'm doing wrong..