I have a problem when trying to UPDATE MySQL database. I'll write the code below.
The problem is that, I have some reviews/feedbacks from my application, and I'm trying to edit a comment from one of them. I'll put the code here:
HTML CODE
<input type="text" size="70"
id="edit<?php echo $row['id'];?>"
name="edit"
style="display: none;">
<input type="image"
name="save"
id="save<?php echo $row['id'];?>"
value="<?php echo $row['id'];?>"
onclick="ask_confirm('Are you sure you want to edit the comment?','save<?php echo $row['id']; ?>')" style="display: none;" src="png/accept.png" />
PHP CODE
if(isset($_POST['save']) && isset($_POST['edit'])){
$edit = $_POST['edit'];
foreach($_POST['save'] as $here)
mysqli_query($con,"UPDATE feedback_rate SET comment = ".$edit." WHERE id = $here");
}
And when I print_r($_POST), it shows me this:
Array (
[edit] =>
[save_x] => 8
[save_y] => 9
[save] => 48
)
It doesn't take the [edit] POST. Any help would be great! Thanks guys!