I don't quite understand how to process forms with PHP.
I have a site with a memberlist, and for each member there is a checkbox.
<input type=\"checkbox\" name=\"admin[$username]\">
if checked, when I click submit, the following query should be executed:
mysql_query("UPDATE tq_users SET admin='1' WHERE id='$id'") or die ("Error:".mysql_error());
this is what I tried using:
do {
if ($admin[$username] == "checked") {
mysql_query("UPDATE tq_users SET admin='1' WHERE id='$id'") or die ("Error:".mysql_error());
}
echo "Updated";
} while ($myrow = mysql_fetch_array($result));
but I get this error:
Warning: Undefined index: in Admin/Users.php on line 77
line 77 is :
if ($admin[$username] == "checked") {