title: Count variables with same name and display name and number
body: <p>I have the next mysql query:</p>
  
  <pre><code>    $productn = $jdb-&gt;query('SELECT t2.title FROM '.DB_PREFIX.'shopping_cart AS t1 LEFT JOIN '.DB_PREFIX.'shop_order_details AS t2 ON t1.shopid WHERE t1.session = "'.smartsql($_SESSION['shopping_cart']).'"');
  
  while ($rowp = $productn-&gt;fetch_assoc()) {
  // my product title
   $productname = $rowp["title"];
  }
  </code></pre>
  
  <p>Using the print_r($productname); I'm getting something like:</p>
  
  <p>Name1Name1Name1Name2Name2</p>
  
  <p>I want to display something like:</p>
  
  <p>3 x Name1
  2 x Name2</p>
  
  <p>OR </p>
  
  <p>3 x Name1, 2 x Name2</p>
  
  <p>It is possible to make this ?</p>