title: How can I display columns with the same name from two different tables?
body: <p>I have made an SQL query from two tables. Everything works good but problem is that this two tables have the same field names and after I do not know how to display them correct, how to tell that    $data['aaa'] is from table 1 and the same $data['aaa'] from table 2</p>
  
  <p>here is my SQL query :</p>
  
  <pre><code>    $query_str = "SELECT 
                      cm.id,
                      cm.global_category_id,
                      cm.num,
                      cm.menu_lv,
                      cm.menu_ru,
                      cm.menu_en,
                      u.id,
                      u.menu_lv,
                      u.menu_ru,
                      u.menu_en
                      FROM products_category cm, products_global_category u
                      WHERE cm.global_category_id = u.id
                      ";
  </code></pre>
  
  <p>and display data </p>
  
  <pre><code>&lt;? foreach ($sub_category_list as $line) : ?&gt;
  &lt;tr&gt;
     &lt;td&gt;&lt;?=$line['menu_lv']?&gt;&lt;/td&gt;   &lt;---- here I want to display data from products_global_category u       
     &lt;td&gt;&lt;?=$line['sub_menu_lv']?&gt;&lt;/td&gt;   &lt;---- products_category cm
     &lt;td&gt;&lt;?=$line['sub_menu_ru']?&gt;&lt;/td&gt;   &lt;---- products_category cm
     &lt;td&gt;&lt;?=$line['sub_menu_en']?&gt;&lt;/td&gt;   &lt;---- products_category cm
  &lt;/tr&gt;
  &lt;? endforeach; ?&gt;
  </code></pre>