Php loop create array inside php code
<p>I need some help with the following code...</p>

<p>How do I create the array from a mysql db:</p>

<p>I have already created the connection set: I want to get the data for my domain from the db, this I can do - My problem is mainly how to create the loop...</p>

<pre><code>&lt;?php
// Each sponsor is an element of the $sponsors array:
$sponsors = array( 
    array('domain1.com','The biggest social network in the world.','http://domain1.com/'),
    array('domain2.com','Imaging and optical technology manufacturer.','http://domain2.com/'));
// Randomizing the order of sponsors:
shuffle($sponsors);
?&gt;
</code></pre>

<p>I have tried to do it like this:</p>

<pre><code>do {
array(''.$row_rs_domainrecord['g_sites_image'].'','The biggest social network in the world.',''.$row_rs_domainrecord['g_sites_url'].''),
} while ($row_rs_domainrecord = mysql_fetch_assoc($rs_domainrecord)););
</code></pre>

<p>but get an error here</p>

<p>But are not getting the results and get an error <code>$sponsors = array(</code> </p>

<p>What would be the easiest way to greate this loop?</p>

<p>Thanks</p>
