I think a little debuging code might help here 😉 try putting a couple of print_rs about like in the code below.
$user=2;
$result=mysql_query("SELECT user_test FROM user_test WHERE user='$user'",$bd);
$mytest=mysql_fetch_array($result);
echo("==>tag1: <br />\n");
print_r($mytest);
$result2=mysql_query("SELECT * From test ",$db);
while($row=@mysql_fetch_array($result2)){
echo("<br />\n==>tag2: <br />\n");
print_r($row);
if(in_array($row[test_id],$mytest)){
$sel="checked";
}else{
$sel="";
}
echo"<input type=checkbox name=mtest[] value=$row[test_id]
$sel>$row[test_name]
}
I think it might be more helpfull for you to look at the results and see where it's going wrong yourself. If however I've got things wrong and this doesn't help at all then go on the members page and pick someone to slap 😉
HTH
Bubble