PHP: insert query result into array elements
<p>How can I assign query result into array elements? </p>

<p>This is my code:</p>

<pre><code>include('db.php');

$conn = mysql_connect($dbhost, $dbuser, $dbpass) or die("Database connection error");
mysql_select_db($dbname);
$query = "select * from test where value=20";
$result = mysql_query($query);
$vegetable_list = array('$rice', '$wheat', '$potato', '$pulses');
$i = 1;
while($row_result = mysql_fetch_row($result))
{
    ??????? = $row_result[$i];
    $i++;
}
</code></pre>

<p>How can I assign the query result into the array? Let's say:</p>

<pre><code>$rice = $row_result[1];
$wheat = $row_result[2];
$potato = $row_result[3];
</code></pre>

<p>How I can assign the values automatically?</p>
