how to update mysql with inputs and checkboxes
- by Ronnie Chester Lynwood
hi. with this code:
<?
if (isset($_POST['onay'])) {
foreach ($_POST['secilen'] as $zuha) {
$olay = mysql_query("update mp3 SET aktif = '1' WHERE id = '$zuha'");
}
if ($olay) {
echo "islem tamam";
exit;
}
}
?>
and with this form: (select * from mp3 aktif = '0')
<form name="form" method="post">
<input readonly type="text" name="id" value="<?=$haciosman['id']?>" />
<input type="text" name="baslik" value="<?=$haciosman['baslik']?>
<input type="checkbox" name="secilen[]" value="<?=$haciosman['id']?>">
<input type="submit" name="onay" value="Onayla" />
I can set "aktif to 1" for each row that i checked. but i want to update "baslik" too! how can i update each "baslik" with that php code?