title: MySQL: Left join and column with the same name in different tables
body: <p>Consider:</p>
  <pre><code>SELECT * FROM `product` left join category on product.category_id = category.id
  </code></pre>
  <p>This query works fine. But the problem is, both the product table and the category table have fields named &quot;name&quot; and &quot;id&quot;. So when I fetch the result of this query, it gives me only one name and one id, but I want both id's and name's.</p>
  <p>How can I do this without having to rename the fields?
  Is it possible to return with custom names such as <em>product_name</em> and <em>category_name</em>?</p>