[RESOLVED] Mysql Help!!!!!!
okay in my script i have it list a bunch of checkbox's.
The code is sumtin like this for listing the checkbox's with each extracted name.
PHP Code:
$sql = "SELECT * FROM members WHERE trainer = 1";
$result = mysql_query($sql) or die(mysql_error());
while($row = mysql_fetch_array($result)) {
echo" <tr>
<td scope=col><input name=rem_trainer type=checkbox value=$row[username]>$row[username]</td>
</tr>";
}
now when i check multiple box's and hit remove trainer. I want to remove each of the selected.
This is how i have it so far... tho it only works for 1 at a time.
PHP Code:
if(isset($_POST['removed'])){
echo "Removed trainer " . $_POST['rem_trainer'] ." from list.<BR>";
mysql_query("UPDATE members SET trainer = 0 WHERE username = '$_POST[rem_trainer]'") or die(mysql_error());
}
any help would be greatly apperciated.