title: Mysql Union in PHP not returning correct results
body: <p>I currently have a mysql Union query that works when placed directly into mysql via the command line, PHP MyAdmin or run in a Mysql editor like Mysql Workbench.  When I run the query through my PHP class it returns two duplicate rows.</p>
  
  <p>The Query:</p>
  
  <pre><code>SELECT `n`.`draftrd`, `n`.`draftteam`, `n`.`nflteam`, `nt`.`logo`, 
      `nt`.`name`, `nt`.`nflcity`,
      `p`.`class`, `p`.`first_name`, `p`.`last_name`
  FROM `players` as `p` 
  LEFT JOIN `nfl` as `n` ON `p`.`playerid` = `n`.`playerid`
  LEFT JOIN `nflteams` as `nt` ON `n`.`nflteam` = `nt`.`nflid` 
  WHERE `n`.`playerid` = 2007000001
  UNION
  SELECT `n`.`draftrd` as `draftRd`, `n`.`draftteam` as `draftTm`, `n`.`nflteam`, 
      `nt`.`logo`, 
      `nt`.`name` as `draftName`, `nt`.`nflcity` as `draftCity`, `p`.`class`, 
      `p`.`first_name`, `p`.`last_name`
  FROM `players` as `p` 
  LEFT JOIN `nfl` as `n` ON `p`.`playerid` = `n`.`playerid`
  LEFT JOIN `nflteams` as `nt` ON `n`.`draftteam` = `nt`.`nflid` 
  WHERE `n`.`playerid` = 2007000001
  </code></pre>
  
  <p>In the editor it returns:</p>
  
  <pre><code>+---------+-----------+---------+-------------+---------+----------+-------+------------+-----------+---------+
  | draftrd | draftteam | nflteam | logo        | name    | nflcity  | class | first_name | last_name | tableid |
  +---------+-----------+---------+-------------+---------+----------+-------+------------+-----------+---------+
  | 2       | 2         | 12      | giants.png  | Giants  | New York | 2007  | Martellus  | Bennett   |       1 |
  | 2       | 2         | 12      | cowboys.png | Cowboys | Dallas   | 2007  | Martellus  | Bennett   |       1 |
  +---------+-----------+---------+-------------+---------+----------+-------+------------+-----------+---------+
  2 rows in set (0.00 sec)
  </code></pre>
  
  <p>The PHP return is:
  (The var_dump version)</p>
  
  <pre><code>array(18) { 
      [0]=&gt; string(1) "2" 
      ["draftrd"]=&gt; string(1) "2" 
      [1]=&gt; string(1) "2" 
      ["draftteam"]=&gt; string(1) "2"
      [2]=&gt; string(2) "12" 
      ["nflteam"]=&gt; string(2) "12" 
      [3]=&gt; string(10) "giants.png" 
      ["logo"]=&gt; string(10) "giants.png" 
      [4]=&gt; string(6) "Giants" 
      ["name"]=&gt; string(6) "Giants" 
      [5]=&gt; string(8) "New York" 
      ["nflcity"]=&gt; string(8) "New York" 
      [6]=&gt; string(4) "2007" 
      ["class"]=&gt; string(4) "2007"
      [7]=&gt; string(9) "Martellus"
      ["first_name"]=&gt; string(9) "Martellus"
      [8]=&gt; string(7) "Bennett" 
      ["last_name"]=&gt; string(7) "Bennett" 
  }
  </code></pre>
  
  <p>I'm not sure what the issue is and why it's not working properly.  I tried creating a temporary table and storing the query in it but it still gives me the duplicated rows.  Is there an easier way to do this or an explanation of why it's happening?  I've dumped the query in PHP to see if the issue is with it's construction but the dumped query returns the rows I'm looking for when run on the command line.</p>