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

  • Home
  • SEARCH
  • 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 8770851
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T17:38:31+00:00 2026-06-13T17:38:31+00:00

Quick issue: I have a checkbox in my code that tells the user if

  • 0

Quick issue:

I have a checkbox in my code that tells the user if the status of a record is DONE or NOT DONE. When the user does a records search in the database, the records that show up, show up with the current record status (DONE or NOT DONE).

If the checkbox is not check means that the record is NOT DONE, so I’m trying to place a checkbox on one side of the record status so the user can check it as soon as they are done working on the record. After they check the checkbox, the value is sent to the DB telling the DB that the new status of the record is DONE

How can I accomplish this when the following example code: (The results are shown after the user made a search using a form)

<?php
if(!isset($_POST['search']))
{
?>

<?php
}
else
{
    $from = trim($_POST['OLD']);
    $to = trim($_POST['NEW']);
    $status = isset($_POST['Status']) ? "AND status = 'DONE' " :"AND status = 'NOT DONE' ";

    $connection = mysql_pconnect("HOST", "USER", "PASS") or die("Connection failed. ".myslq_error());
    mysql_select_db("DBNAME") or die("Unable to select db. ".mysql_error());
    $query = "SELECT * FROM records WHERE Date >= '$from' AND Date <= '$to' ".$status." ORDER BY date ASC";

    $result = mysql_query($query) or die(mysql_error());

    echo "<table class='table' id='SearchResult' cellspacing='0' cellpadding='0'>";
        echo "<tr class='rowa'><b>";
            echo "<td class='col0 cell'>ID</td>";
            echo "<td class='col1 cell'>Name</td>";
            echo "<td class='col2 cell'>Last Name</td>";
            echo "<td class='col3 cell'>Place</td>";
            echo "<td class='col4 cell'>Station</td>";
            echo "<td class='col5 cell'>Phone</td>";
            echo "<td class='col6 cell'>Date of Record</td>";
            echo "<td class='col7 cell'>Status</td>";
        echo "</tr>";
    echo "</table>";
    while($record = mysql_fetch_object($result))
    {   
    echo "<table class='table' id='SearchResult' cellspacing='0' cellpadding='0'>";
        echo "<tr class='rowb'>";
            echo "<td class='col0 cell'>".$record->ID."</td>";
            echo "<td class='col1 cell'>".$record->Name."</td>";
            echo "<td class='col2 cell'>".$record->lastName."</td>";
            echo "<td class='col3 cell'>".$record->Place."</td>";
            echo "<td class='col4 cell'>".$record->Station."</td>";
            echo "<td class='col5 cell'>".$record->Phone."</td>";
            $year_part_of_date = explode('-', $record->date);
            echo "<td class='col6 cell'>".$record->date."</td>";
            echo "<td class='col7 cell'>".$record->Status."</td>";
        echo "</tr>";       
    echo "</table>";
    }   
}
?>


Thanks everyone for showing me the way 😀

  • 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-13T17:38:32+00:00Added an answer on June 13, 2026 at 5:38 pm

    You mean, like this?

    echo "<td class='col7 cell'><input type='checkbox' name='status' ".($record->Status == 'DONE' ? 'checked' : '')."/></td>";
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a quick issue with my connection not being intialized. When I call
i have this quick issue please. I have this code here which permits me
I made the following jsfiddle at http://jsfiddle.net/hxsy6/ The issue I have is that if
I have a quick and asap issue. SELECT `deals`.* FROM `deals` WHERE `is_featured` =
So I have a API issue. So i am creating a class that utilizes
Could you please have a quick look at the sample code http://jsfiddle.net/vXvs2/ I don't
Quick question: I have an activitygroup. Within that Activitygroup I have an activity. If
Real quick background : We have a PDFMaker (HTMLDoc) that converts html into a
Just a quick check really. I have an XML file that I will be
I have a quick question, more theory then actual code. I am building 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.