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?
If I understand you correctly you want to do this:
But this is similar to what you already have in your original question:
The only difference now is that you make the query in a loop and use a different ID variable.
My comments on your code in your original question stay the same. ( 😉 )
P.S.: Introduced
mysql_escape_string()for a little security.UPDATE: Ok I think I got your problem now. You basically want to create an input field collection for every entry in your database, something like this:
You just define another the names of the text fields as arrays
baslik[$haciosman['id']], similar as you did for the checkboxes but this time you specify the array key which is the ID of the record.Then you PHP code you can access this array (
$_POST['baslik']contains an array now) like this:UPDATE 2:
You should really read the official short introduction to forms, follow the links in this article and in general read the official documentation to get more insight in how to work with PHP.