Thanks Firefly, it works almost 100%.
However one thing: $threadid. Where and how did u defined that one because i get an error:
PHP Code:
Warning: Variable passed to each() is not an array or object in user.php on line 280
I'm not using $threadid but $award[awardsid] for the id.
This is my currently code:
PHP Code:
$awards=$DB_site->query("SELECT aw,awardsid,name,url,userid FROM award");
while ($award=$DB_site->fetch_array($awards)) {
if($award[aw] == "$award[awardsid]" and $award[userid] == "$user[userid]") {
$lala="checked";
$was="1";
$kol="yes";
} else {
$lala="";
$was="0";
$kol="no";
}
echo "<tr class='".getrowbg()."'><td><input type='checkbox' name='aw[$award[awardsid]]' value='$kol'";
echo "$lala>$award[name]</td><td nowrap>";
echo "<input type=\"hidden\" name=\"all[$award[awardsid]]\" value=\"$was\">";
echo "<img src=\"$award[url]\"> </td>";
}
while (list($award[awardsid],$was)=each($all)) {
$now=$aw[$award[awardsid]];
if ($now=='yes' and $was=='0') {
$kutje='yes';
} elseif ($now!='yes' and $was=='1') {
$kutje='no';
}
}
Its a little general
