PHP-Code:
$i=1;
$rights = mysql_query("SELECT * FROM $user_cat_tname ORDER BY name");
while ($cat = mysql_fetch_array($rights)) {
echo "<input type='checkbox' class='checkbox' name='catid[$i]'> $cat[name] ";
$i++;
}
$checked = $i;
PHP-Code:
for($i=1; $i<=$checked; $i++) {
mysql_query("INSERT INTO $user_rights_tname (catid, userid) VALUES ('$catid[$i]', '$userid')") or die (mysql_error());
}
Kommentar