checkbox, php and update mysql!

Posted by Ronnie Chester Lynwood on Stack Overflow See other posts from Stack Overflow or by Ronnie Chester Lynwood
Published on 2010-04-01T21:16:23Z Indexed on 2010/04/01 21:23 UTC
Read the original article Hit count: 296

Filed under:
|
|
|

Hello now I got this form. i get values with "while":

mysql_query("select * from mp3 where aktif = '0'");

<form name="form" method="post" action="">
<input type="text" size="10" name="id" value="<?=$haciosman['id']?>" />
<input type="text" name="baslik" value="<?=$haciosman['baslik']?>
<textarea name="sarkisozu"><?=$haciosman['sarkisozu']?></textarea>
<input type="text" name="a3" value="<?=$haciosman['ekleyen']?">
<input type="checkbox" name="onay[]" />
<input type="submit" name="0" id="0" value="Onayla" />
<form>

and updating values with:

<?
if (isset($_POST['onay'])) {
    $cikti = mysql_query("update mp3 set aktif = '1', baslik = '$_POST[baslik]' where id = '$_POST[id]'");
    if ($cikti) {
        echo "islem tamam";
        exit;
    }
}
?>

but this code only updating only one value. how can i let it update multiple values?

© Stack Overflow or respective owner

Related posts about php

Related posts about mysql