title: PHP, MYSQL - joining 2 tables where 1 table has multiple entries of primary key
body: <p>I got 2 tables which I want to select via mysql_query in php.</p>
  
  <ul>
  <li>table1</li>
  </ul>
  
  <p>columns: specialID, Name, Information, Start, created, byUser, ziparea</p>
  
  <ul>
  <li>table2</li>
  </ul>
  
  <p>columns: ID, ziparea, cusID, title, contact, mail</p>
  
  <pre><code>$result = mysql_query("SELECT * FROM table1 JOIN table2 ON table1.ziparea = table2.ziparea WHERE table1.specialID='".$_REQUEST["specialID"]."'");
  while($var = mysql_fetch_array($result)) {
  }
  </code></pre>
  
  <p>table1 has exactly 1 entry for each ziparea from 01 to 99. table2 has multiple entries for zipareas.</p>
  
  <p>The problem which seems to occur is that the result seems to be something like:</p>
  
  <ul>
  <li>table1-data --- data1 ---- data1 --- data1</li>
  <li>ziparea -------- 24 -------- 24 -------- 24</li>
  <li>table2-data --- data1 ---- data2 --- data3</li>
  </ul>
  
  <p>means the data of table1 gets copied. I want the cells to be empty, because if I i.e. ask for table1.Name in php, </p>
  
  <pre><code>&lt;?php echo utf8_encode($var["Name"]); ?&gt;
  </code></pre>
  
  <p>it should only give 1 data... now it comes with 3 copies of that one data I need.</p>
  
  <p>How can I solve this problem?</p>