php array replicate format in while loop
<p>I want to output the result of a query so that the format is the same as:</p>

<pre><code>$links = array(
'Link 1' =&gt; '/link1',
'Link 2' =&gt; '/link2'
);
</code></pre>

<p>So the query is</p>

<pre><code>$query = "SELECT * FROM link";
$result = mysql_query($query, $connection) or die(mysql_error());
$row = mysql_fetch_assoc($result)
</code></pre>

<p>The field that need to be output are:</p>

<pre><code>$row['link_title'] and $row['url']
</code></pre>
