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

The Archive Base Latest Questions

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

Question is how to update string field by concatenating to it? Here is code

  • 0

Question is how to update string field by concatenating to it?

Here is code for creating database and adding one row:

CREATE DATABASE  my_db;                                                          
USE my_db;

CREATE TABLE IF NOT EXISTS my_table(
     article_id INTEGER unsigned,
     revision_ids VARCHAR(10),
     PRIMARY KEY (article_id)
);

INSERT INTO my_table (article_id, revision_ids) VALUES (1, "154");

I need to write code which concatenate string to revision_ids field. For example, I need to concatenate “, 999” to “154”, so I will get “154, 999”. My version of code does not work:

UPDATE my_table SET revision_ids = CONCAT((SELECT revision_ids FROM my_table WHERE article_id = 1), ", ", "999") WHERE article_id = 1;

How to do it?

There is one important condition. Theoretically this concatenation could do several scripts, so it is important that while our updating nobody can change the field value.

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

    This should be all you need:

    UPDATE my_table SET revision_ids = CONCAT(revision_ids, ", ", "999") WHERE article_id = 1;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Update: This question was an epic failure, but here's the working solution. It's based
********Update to Question********** If the tableview does not affect the model: Are the index
UPDATE: This question is out of date, but left for informational purposes. Original Question
Update: This question is a duplicate of Are there any programming languages targeting PHP,
I have been following the answer of this question: How to update existing object
Sorry for the double post, I will update this question if I can't get
UPDATE I answered my question below, but I am still asking for a prettier
UPDATE (spoiler): This question is answered (see David Carlisle answere below) and it looks
UPDATE : Since this question is getting some views, I figured I'd better highlight
Update : I found almost exact similar question , yet it has slightly different

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.