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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T05:46:05+00:00 2026-05-26T05:46:05+00:00

Good day to all. I’m trying to make a task tracking module for my

  • 0

Good day to all. I’m trying to make a task tracking module for my system. The logic is, whenever I assign a task to a user, the system updates the task to “IsTaken” meaning the particular user is responsible for that task. Upon updating, it creates an entry into “user_task” table which basically ties together the task and the user table. Whenever I assign a task to somebody it’s fine. But when I do it again, the previous task record’s IsTaken field reverts back to 0. I try to re-assign it, but again, the previous record reverts. It’s quite weird. I’m using XAMPP, MySQL and PHP. I’m hoping I’m not the only one experiencing this. Any help would be much appreciated.

Here are my tables:

CREATE TABLE IF NOT EXISTS `task` (
  `Task_No` int(11) NOT NULL AUTO_INCREMENT,
  `Task_Name` varchar(100) NOT NULL,
  `Task_Desc` varchar(450) DEFAULT NULL,
  `Task_DateCreated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `Task_IsTaken` tinyint(1) NOT NULL,
  PRIMARY KEY (`Task_No`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;

CREATE TABLE IF NOT EXISTS `user_task` (
  `UT_No` int(11) NOT NULL AUTO_INCREMENT,
  `User_Email` varchar(100) NOT NULL,
  `Task_No` int(11) NOT NULL,
  `Task_Duration` varchar(20) NOT NULL,
  `Task_DateTaken` date DEFAULT NULL,
  `Task_DateFinished` timestamp NULL DEFAULT NULL,
  `Task_IsIssue` tinyint(1) NOT NULL,
  PRIMARY KEY (`UT_No`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;

And here are my scripts (from the form):

//Process - Insert Task
if(isset($_POST['btnCreateTask']))
{
if($_POST['taskName']!=NULL)
{
$taskName = mysql_real_escape_string ($_POST['taskName']);
$taskDesc = mysql_real_escape_string ($_POST['taskDesc']);
$insertTask = "INSERT INTO task(Task_Name, Task_Desc, Task_IsTaken) VALUES('$taskName', '$taskDesc', 0)";
$sqlResult1 = mysql_query($insertTask);}
else
{
    echo "No task name given";
    $errorCode = 1;
}
}


if(isset($_POST['btnAssignTask']))
{
    if($_POST['assignTaskName']!=NULL)
{
    $assigntaskName = mysql_real_escape_string($_POST['assignTaskName']);
    $assigntaskNo = mysql_real_escape_string($_POST['assignTaskNo']);
    $assigntaskOwner = mysql_real_escape_string($_POST['assignTaskOwner']);
    $assigntaskDuration = mysql_real_escape_string($_POST['assignTaskDuration']);
    $updateUpcomingTask = "UPDATE task SET Task_IsTaken = '1' AND Task_No = '$assigntaskNo'";
    $createUserTask = "INSERT INTO user_task (User_Email, Task_No, Task_Duration, Task_DateTaken, Task_DateFinished) 
                        VALUES ('$assigntaskOwner', '$assigntaskNo', '$assigntaskDuration', '$now', NULL)";
    $sqlResult2 = mysql_query($updateUpcomingTask);
    $sqlResult3 = mysql_query($createUserTask);
}
else
{
    echo "No task selected";
    $errorCode = 2;
}
}
  • 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-05-26T05:46:06+00:00Added an answer on May 26, 2026 at 5:46 am

    Your code should be changed to:

    if(isset($_POST['btnAssignTask']))
    {
        if($_POST['assignTaskName']!=NULL)
    {
        $assigntaskName = mysql_real_escape_string($_POST['assignTaskName']);
        $assigntaskNo = intval($_POST['assignTaskNo']);
        $assigntaskOwner = mysql_real_escape_string($_POST['assignTaskOwner']);
        $assigntaskDuration = mysql_real_escape_string($_POST['assignTaskDuration']);
        $updateUpcomingTask = "UPDATE task SET Task_IsTaken = '1' WHERE Task_No = $assigntaskNo";
        $createUserTask = "INSERT INTO user_task (User_Email, Task_No, Task_Duration, Task_DateTaken, Task_DateFinished) 
                        VALUES ('$assigntaskOwner', '$assigntaskNo', '$assigntaskDuration', '$now', NULL)";
        $sqlResult2 = mysql_query($updateUpcomingTask);
        $sqlResult3 = mysql_query($createUserTask);
    }
    else
    {
        echo "No task selected";
        $errorCode = 2;
    }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Good Day All we are trying to do is inside a trigger make sure
Good day all; I am trying to manually (not using sublayers) draw images within
Good day all, In my application I am allowing the user to browse their
a very good day to all of you . I am trying to compare
Good day all, I am trying to deploy my ASP.NET MVC3 app to my
Good morning all, After a day of googling, I’m at a loss. I decided
Good day all, for running multiple threads concurrently is it advisable to create different
Good day all, I am tasked with building a slider for our site. Here
Good day all I have the following question: I would like to use Chart
Good day all; I have an UIImageView that I animate around a large UIView.

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.