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:

([$ Line ['accept'] == 1) {echo "input type = \" checkbox \ "name = \" check [{$ Row ['id']}]

  "Value = \" 0 \ "& gt; disapproved"; } Else {echo " $ of  in your  foreach  loop will be the indicator of the check box in  POST , Code> Data. < / P> 

Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -