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 7958107
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T04:22:10+00:00 2026-06-04T04:22:10+00:00

I am building a simple app whose basic task is to approve the content

  • 0

I am building a simple app whose basic task is to approve the content listed from a MySQL table. List items are long, like 15 to 20 items. I want to place a check-box right to the list items and allow the users to check multiple items and click submit button to approve selected items.

I have made a basic flag column on the table to set 0 or 1 for approve or disapprove. In my existing system user has to click the link and go to the particular page and click approve to approve the item.I want to shorten the process by allowing the users to check the check-box and select multiple entry to approve those items at one time.

enter image description here

this is my table and the item is YouTube link so the admin can view the video and if it good he/she can approve it by checking the check-box.

here is the php code for the current page specific to approve the item

<?php 
$msg = "";
$idForm = $_GET['id'];

if( isset( $_POST['submit'] ) ){
    $msg= approveVideo($idForm);
}
?>

the approveVideo function:

function approveVideo($id) {
    $message ="";
    $query= "UPDATE locus_videos SET set_flag='1' WHERE id='{$id}'";

    if(mysql_query($query)) {
        $message ="Video Approved ";
    }else {
        die("failed: " . mysql_error());    
    }

    return $message;

}

The Table format for the php file:

<table width="100%" height="487" border="0" cellpadding="5" cellspacing="5">

” method=”POST”>

    <table width="100%" border="0" cellspacing="5" cellpadding="5">

Uploader Name
Video Link

“>

” target=”_blank”>

  </form>
</td>

In my current version when the user click the link of the video this redirect to the specific page and from there only he can approve the video (the YouTube link)

  • 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-04T04:22:11+00:00Added an answer on June 4, 2026 at 4:22 am

    There are two ways, depending if you just want to “approve” rows, or “approve” and “disapprove” rows.

    First:

    <table>
        <thead>
            <tr>
                <td>&nbsp;</td>
                <td>Url</td>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td><input type="checkbox" name="Approve[]" value="1" /></td>
                <td>http://www.youtube.com/...</td>
            </tr>
            <tr>
                <td><input type="checkbox" name="Approve[]" value="2" /></td>
                <td>http://www.youtube.com/...</td>
            </tr>
            <tr>
                <td><input type="checkbox" name="Approve[]" value="3" /></td>
                <td>http://www.youtube.com/...</td>
            </tr>
        </tbody>
    </table>
    

    As you can see, there is a checkbox with the name “Approve[]” and a different Value for each row. The value is the ID column of your table.

    Within your PHP, you would then use the following:

    function approveVideos($ids)
    {
        $message = '';
        $query = 'update locus_videos set set_flag = 1 where id in (' . implode(',', $ids) . ')';
        if(mysql_query($query)) 
        {
            $message ="Videos Approved ";
        }
        else 
        {
            die("failed: " . mysql_error());    
        }
        return $message;
    }
    
    
    $ids = $_POST['Approve'];
    approveVideos($ids);
    

    Second:

    <table>
        <thead>
            <tr>
                <td>&nbsp;</td>
                <td>Url</td>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td><input type="hidden" name="Approve[1]" value="0" /><input type="checkbox" name="Approve[1]" value="1" /></td>
                <td>http://www.youtube.com/...</td>
            </tr>
            <tr>
                <td><input type="hidden" name="Approve[2]" value="0" /><input type="checkbox" name="Approve[2]" value="1" /></td>
                <td>http://www.youtube.com/...</td>
            </tr>
            <tr>
                <td><input type="hidden" name="Approve[3]" value="0" /><input type="checkbox" name="Approve[3]" value="1" /></td>
                <td>http://www.youtube.com/...</td>
            </tr>
        </tbody>
    </table>
    

    Within the PHP, you would do the following:

    function setVideoFlag($id, $flag = 1)
    {
        $message = '';
        $query = 'update locus_videos set set_flag = ' . $flag . ' where id = ' . $id;
        if(mysql_query($query)) 
        {
            $message ="Video " . ($flag == 1 ? 'Approved' : 'Disapproved');
        }
        else 
        {
            die("failed: " . mysql_error());    
        }
        return $message;
    }
    
    foreach($_POST['Approve'] as $id => $flag)
    {
        setVideoFlag($id, $flag);
    }
    

    I hope that helps?

    Gavin

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

Sidebar

Related Questions

I'm building a simple aggregator-type app that would pull in data from multiple websites
I'm soon going to be starting some iPhone Development (3.0) building a simple app
I have an app i building which is a simple naviagtion app. I do
I'm building a simple play against a random opponent back-end using Goole App Engine.
I have done simple java app for blackberry, while building am getting following error.
The app we're building has a simple button that starts a facetime session with
I'm building a web app to design and animate simple 3d scenes using the
I'm building a simple app and trying to test DB result output. But unfortunately
I'm diving into iOS development. I am building a simple Diary app. I'd like
I'm building a (very) simple FTP app in Cocoa, and I need to store

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.