Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8083829
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T17:36:01+00:00 2026-06-05T17:36:01+00:00

Form is made from a function that prints out all rows that are awaiting

  • 0

Form is made from a function that prints out all rows that are awaiting approval;

function all_reviews(){
$query1= mysql_query("SELECT * FROM {$table} WHERE first != '' && disp_state= '0' && rejected != '1'");
if (!$query1) {
    die("Query to show fields from table failed");
}
$fields_num = mysql_num_fields($query1);

// printing table rows
while($row = mysql_fetch_array($query1))
{
//review action buttons
        echo "<div class=\"rev_action\">";
        echo "<input type=\"hidden\" name=\"".$row['id']."\">";
        echo "<input type=\"submit\" name=\"accept\" value=\"Approve\" class=\"success rev_button\" onclick=\"document.getElementById('review_action').submit()\">";
        echo "<input type=\"submit\" name=\"reject\" value=\"Reject\" class=\"error rev_button\" onclick=\"document.getElementById('review_action').submit()\">";
        echo "</div>";
}

I’m guessing that the proper way is by printing out the row id in a hidden input. Problem is, there could be more than 1 row that print out at a time.

How do I select the exact row related to the approve or reject button?

html:

<form name="form" action="include/review_submit.php" id="review_action" method="post">

    <?php all_reviews(); ?>

</form>

php (review_submit.php):

//database server connection 
mysql_connect ("$servername","$dbusername","$dbpassword") or die(mysql_error());
//database connection 
mysql_select_db("esd_db") or die(mysql_error()); 

//data feilds from review form
if($_POST['button'] == "Approve") {
   //code to update given row with an approval status
}

//data feilds from review form
if($_POST['button'] == "Reject") {
   //code to update given row with an rejection status
}
//insert values into table
 mysql_query("UPDATE `reviews` ") or die(mysql_error());

 Print "Success"; 

?>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T17:36:02+00:00Added an answer on June 5, 2026 at 5:36 pm

    You could always make each row a different form, and pass it to a dynamic URL, where the GetDATA would tell of which one you selected.

    Or alternately, you could NOT use a form, and have each one link to a page. (Assume that the action page is action.php, and you have 100 rows. You could have action.php?row=1&ac=y, action.php?row=1&ac=n, etc)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I made a form class in c# that has a devexpress grid, a label
I have made a form that accepts query and executes it through php. I
In my iOS application I have made a form that should submit data into
I have a dynamic form that adds users to the site, made so you
I have a registration form on my layout grid, made out of a stackPanel.
I am building a form in HTML out of a javascript object that I've
I've made a login that uses ajax to send the form to a php
I got stuck. I am trying to form a function that will eat classless
I've made jQuery & AJAX script that uses a PHP function to bring back
I have a simple form that has a list (dropdown list generated from a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.