title: MySql how to display data from multiple tables only once?
body: <p>I have two tables in my database - "region" and "attraction". I made a JOIN query that will get data from both of them and I am displaying it afther that. Here is my code:</p>
  
  <pre><code>$regionsId = $_GET['region']; 
  
  //$sql    = "SELECT `RegionID`, `RegionName`  FROM `region` WHERE `RegionID`='$regionsId'";
  //$sql    = "SELECT `AttractionID`, `Name`, `imglink2`  FROM `attractions` WHERE `RegionID`='$regionsId'";
  
  $sql ="SELECT * 
  FROM region
  INNER JOIN attractions WHERE region.RegionID = '$regionsId' AND attractions.RegionID = '$regionsId'";
  
  
  $result = mysql_query($sql, $link);
  
  if (!$result) {
      echo "DB Error, could not query the database\n";
      echo 'MySQL Error: ' . mysql_error();
      exit;
  }
  
  
  
  while ($row = mysql_fetch_assoc($result)) {
  
      echo $row['RegionName']; 
  
      echo "&lt;a href='attraction.php?village=" . $row['AttractionID'] . "'&gt;" .  "&lt;br /&gt;" .
            $row['Name']  .
             "&lt;br /&gt;" .
  
           "&lt;img src='" . $row['imglink2'] . "' height='130' width='150'&gt; 
  
         &lt;/a&gt;";
  
  
  
  }
  
  
  
  
  
  mysql_free_result($result);
  
  
  
   ?&gt;
  </code></pre>
  
  <p>My problem is that When I display it the echo $row['RegionName'];  is displayed multiple times, with every attraction I am displaying. How can I make it so that it is displayed only once?
  Thank you. </p>