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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T12:04:31+00:00 2026-06-11T12:04:31+00:00

I have a form used to update the following table where LoationName= $locationName +——–+———————+————–+——+

  • 0

I have a form used to update the following table where LoationName= $locationName

+--------+---------------------+--------------+------+
|Id |LocationName|TaskComplete | TaskNotes           |
+--------+---------------------+--------------+------+
|001| NYC,FRA,UK |no,yes,no    |NULL,Task Completed-FRA,NULL
|002| NYC,FRA,UK |no,no,yes    |NULL,NULL,task-completed @ UK
|003| NYC,FRA,UK |no,no,yes    |NULL,Task-started-FRA,completed Mar 3rd

How can I update the task-complete and task-notes col with the information corresponding to the correct locationName? If NYC updates their status the table should be updated as

+--------+---------------------+--------------+------+
|Id |LocationName|TaskComplete | TaskNotes           |
+--------+---------------------+--------------+------+
|001| NYC,FRA,UK |yes,yes,no   |NYC NOTES,Task Completed-FRA,NULL
|002| NYC,FRA,UK |yes,no,yes   |NYC-Finished task2,NULL,task-completed @ UK
|003| NYC,FRA,UK |yes,no,yes   |Completed-Tuesday,Task-started(FRA),completed Mar 3rd

I have a total of 100 task that must be completed by 25 locations. The following UPDATE statement will is ok but will not work in our scenario since it just updates the col with a single value i.e (“yes” or “no”).

UPDATE operations_checklist SET TaskComplete='$val' where TaskId IN($i)

I’m thinking my solution is to EXPLODE the TaskComplete values then use array_replace to update the necessary value-/position. What would be the best solution?

I may end up creating a table with 77 cols for TaskName, 77 cols for TaskNotes, 77 cols completeDate, etc… thoughts?

  • 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-11T12:04:32+00:00Added an answer on June 11, 2026 at 12:04 pm

    Since there isn’t a SPLIT function built in MySQL, using a query for this action isn’t mind acceptable, you will need write a FUNCTION yourself or write a long worthless algorithm to use built in functions for a such action …

    I highly suggest to use php for this one as you said yourself and explode your data, replace what you want and then implode it back and update your record …

    UPDATE
    Just a note about your table structure, you could do this in place of your current structure:

    Create a second table with this structure:

    +----+----------+------------+
    | FK | TaskType | TaskStatus |
    +----+----------+------------+
    | 1  | 1        | True
    | 1  | 2        | False
    | 2  | 1        | False
    

    This table will be linked through FK to your main table and in place of using ~70 commas in a field there, use TaskType 1, 2, …, 70 in this and set the TaskStatus to true or false for yes and no, absenting a TaskType for a FK would also mean no here …

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

Sidebar

Related Questions

I have a simple form that is used to update an entity in my
update I have made a Drupal Form with the Form API. I used a
Once I have programmed GUI with Java and have used Form Layouts. Form layout
I have a registration form and used fieldset to order the input fields in
In my sinatra app i have a form which is used to submit data
We have used Google form, Wufoo form to try to securely capture the info
I have used hook_form_FORM_ID_alter( ) function to alter a menu_edit_menu form to add few
I have created a form that is used for both adding and editing a
In my c# application i have this small form which is used to set
I created a form using Swing in Java. In the form I have used

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.