title: MySQL join and column names
body: <p>Let's say that I have the following tables in my MySQL database:</p>
  
  <pre><code>TABLE Products
  | id | some_column1 | some_column2 |
  
  TABLE ProductProperties
  | id | product_id | name |
  </code></pre>
  
  <p>Oversimplified, but sufficient. Now I want to get all products with properties. I do:</p>
  
  <pre><code>SELECT * FROM `Products` JOIN `ProductProperties` ON Products.id = ProductProperties.product_id
  </code></pre>
  
  <p>What do I get?</p>
  
  <pre><code>| id | some_column1 | some_column2 | id | product_id | name |
  </code></pre>
  
  <p>It's not cool, and I want to make it cool in one of the two ways:</p>
  
  <p>1) To get the array of objects like in Product table, but extended by one more member, which would be the array of properties which matched JOIN. I've sort of figured out already that it's impossible?</p>
  
  <p>2) To get the array like this (I'd still have to iterate over it in PHP to join all properties in one product into one object):</p>
  
  <pre><code>| product_id | some_column1 | some_column2 | property_id | product_id | name |
  </code></pre>
  
  <p>So I'd like to rename the column ProductProperties.id into ProductProperties.property_id. If I could remove ProductProperties.product_id from the output too, that would be ideal, but for now, I only want the way to rename one column in the output. Or to prefix it by table name. Or something like that.</p>
  
  <p>Doable?</p>