title: Using the nth item in a php array
body: <p>I have created an array, as follows:</p>
  
  <pre><code>$results = array();
  do {
    $results[] = $row_products;
  } while ($row_products = mysql_fetch_assoc($products));
  
  print_r($results);
  </code></pre>
  
  <p>This prints out the array like this:</p>
  
  <pre><code>Array ( 
  [0] =&gt; Array ( 
         [productName] =&gt; product1 
         ) 
  [1] =&gt; Array ( 
         [productName] =&gt; product2 
         ) 
  [2] =&gt; Array ( 
         [productName] =&gt; product3 
       )
  </code></pre>
  
  <p>I want to now use say the second item in the array in another mysql query.</p>
  
  <p>But I cannot define it. I have tried</p>
  
  <pre><code>$results[1];
  </code></pre>
  
  <p>but this does not work.
  So in effect, if I echo the second item, it would print 'product2'.</p>