mysql - Database update with PHP -
I am trying to add the ability to accept or reject reviews from the mysql database, and I do not know the problem this is. I tried and searched for 3 hours now, but I can not solve it. Code written briefly:
if ($ line ['accept'] == 1) {echo "input type = \" checkbox \ "name = \" check [] \ "value = \ "0 \" & gt; Disapproved "; } Else {echo "& lt; input type = \" checkbox \ "name = \" check [] \ "value = \" 1 \ "& gt; accept; } If (isset ($ _ request) and isset ($ _ POST ['check']) {if (empty ($ _ POST ['test'])) {foreach ($ _ POST ['check'] $$ as key = & gt; $ value) {mysqli_query ($ con, "UPDATE feedback_rate SET accepts = $ value where id = $ key"); Echo "& lt; east & gt;"; Print_r ($ _post); Echo "& lt; east & gt;"; }}}
Can someone help me and tell me what is the problem? Thank you very much!
You id
to name
attribute:
"Value = \" 0 \ "& gt; disapproved"; } Else {echo " $ of
in yourforeach
loop will be the indicator of the check box inPOST , Code> Data. < / P>
Comments
Post a Comment