populate values of a row from the id selected
<p>I'm using PHP to populate names into an option list based on values from a database. 
Once a name is selected I want to populate the values of a row based on whatever name has been selected.</p>

<p>I had no problem populating the option list with the name values, but once I select a name the records of that row will not display in the input boxes. </p>

<p>Here is the code I'm working with:</p>

<pre><code>$query = "SELECT name, id 
FROM artists 
ORDER BY name";

$mysql_stuff = mysql_query($query, $mysql_link);
while($row = mysql_fetch_row($mysql_stuff)) {

 $artists_name = htmlspecialchars(stripslashes($row[0]));
 $artists_id = stripslashes($row[1]);

    // we compare the id of the record returned and the one we have selected
    if ($artists_id) { 
        $selected = $artists_id;
    } else {
        $selected = "";
    }
    print("&lt;option value=\"$artists_id\"&gt;$artists_name&lt;/option&gt;
    ");
}

print("&lt;/select&gt;
&lt;input type=\"Submit\" name=\"submit\" value=\"Update\"&gt;
&lt;input type=\"Submit\" name=\"delete\" value=\"Delete\"&gt;

&lt;br &gt;
&lt;br /&gt;
Edit Biography:
&lt;/td&gt;
&lt;/tr&gt;
");

if (isset($_POST['submit'])) {
    print("&lt;tr valign=\"top\"&gt;
    &lt;td valign=\"top\" width=\"150\"&gt;Name&lt;/td&gt;
    &lt;td valign=\"top\"&gt;Artist Biography&lt;/td&gt;
    &lt;/tr&gt;

    ");


    print("&lt;tr valign=\"top\" bgcolor=\"$colour\"&gt;
    &lt;td valign=\"top\"&gt;
    &lt;input type=\"text\" name=\"artists_name[$selected]\" value=\"$artists_name\" size=\"40\" /&gt;
    &lt;/td&gt;

    &lt;td valign=\"top\"&gt;
    &lt;textarea name=\"artists_Biography[$selected]\"  cols=\"40\" rows=\"10\"&gt;$artists_Biography&lt;/textarea&gt;
    &lt;/td&gt;


    &lt;/tr&gt;
    ");

}   


print("&lt;/table&gt;
&lt;/form&gt;
");
</code></pre>

<p>Can I please get some assistance with populating the values of the selected name into the input boxes.</p>
