Forum Moderators: coopster
In another table (music_type) you have types of music with their names and values!
I had it done this way and it works great!
...<td>Music type:</td>
<td><table width=\"100%\" border=\"0\">";
$sql2= "select name, music_value from music_type";
$resul2t=mysql_query($sql2) or die(mysql_error());
while ($row2=mysql_fetch_array($resul2t))
{
$music_value=$row2["music_value"];
$name=$row2["name"];
echo"<tr><td><input name=\"music_type[]\" type=\"checkbox\" value=\"$music_value\"";
$sql3="select music_value from users where user = '$_POST[user]'";
$result3 = mysql_query($sql3) or die(mysql_error());
while ($row3 = mysql_fetch_array($result3)){
$music = $row3["music_type"];
if ($music == $music_value)
{
echo"checked";
}
}
echo"
>$name</td></tr>";
}
echo "</table></td>
</tr>
...
It works for radio buttons too and I guess it could be modified for select menus!
I just wanna know if this is the standard way of doing this sort of thing, are there other ways, because I kinda came out with this myself!
I found some tutorials on the net that explain similar things and they were way too complicated!