Multi dimensional array
<p>Have just come across a problem where I believe this is the solution.</p>

<p>At the moment I have the following code:</p>

<pre><code>function siteUsers()
{
    global $database;
    $q = "SELECT username, id FROM ".TBL_USERS."";
    return mysql_query($q, $this-&gt;connection);
}

function generateUserArray() 
{
    $u = array();
    $i = array();
    $result = $this-&gt;siteUsers();
    while( $row=mysql_fetch_assoc($result)) 
    {
        $u[] = $row['username'];
        $i[] = $row['id'];
    }
    return $u, $i;
}
</code></pre>

<p>As you can see, when I then go onto use foreach, the u and i get split apart.
Is there anyway that I could keep them together?</p>

<pre><code>foreach ($u as $username) {
  echo"&lt;option value='$i'&gt;$username&lt;/option&gt;";
}
</code></pre>

<p>What I need it the option value to be the id and the visual value to be the username.
Is this possible?
Thanks</p>
