title: How to manipulate arrays in PHP and MySQL?
body: <p>I have a code like this.</p>
  
  <pre><code>mysql_connect("localhost", "root", "") or die(mysql_error());
  mysql_select_db("joomla") or die(mysql_error());
  
  $result = mysql_query("SELECT id,name FROM jos_samples") or die(mysql_error());  
  
  
  
  while($row = mysql_fetch_array( $result )) {
  print_r($row);
  }
  </code></pre>
  
  <p>And my print array is like this.</p>
  
  <pre><code>Array ( [0] =&gt; 3 [id] =&gt; 3 [1] =&gt; User1 [name] =&gt; User1 )
  Array ( [0] =&gt; 4 [id] =&gt; 4 [1] =&gt; User2 [name] =&gt; User2 ) 
  Array ( [0] =&gt; 5 [id] =&gt; 5 [1] =&gt; User3 [name] =&gt; User3 ) 
  Array ( [0] =&gt; 6 [id] =&gt; 6 [1] =&gt; User4 [name] =&gt; User4 ) 
  </code></pre>
  
  <p>I want this array something like this</p>
  
  <pre><code>Array ( [3] =&gt; User1 [4] =&gt; User2 [5] =&gt; User3 [6] =&gt; User4 )
  </code></pre>
  
  <p>How can I proceed?</p>