Append to a record

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Craig Keightley

    Append to a record

    Is it possible to append text to the end of an existing record

    I know of UPDATE sysntax but i want to be able to add additional text to a
    record

    eg

    column text = "hello"
    amended ist time = "hello world"
    amended 2nd time "hello world - how are you?"
    etc etc


  • Aggro

    #2
    Re: Append to a record

    Craig Keightley wrote:[color=blue]
    > Is it possible to append text to the end of an existing record[/color]

    Yes

    Example:
    update tablename set name=concat( name, "hhh") where id=8;

    More string functions:

    Comment

    • Ondernemer

      #3
      Re: Append to a record


      "Aggro" wrote:[color=blue]
      > Example:
      > update tablename set name=concat( name, "hhh") where id=8;[/color]

      So how do you add "," + $var?

      e.g. a field has values "223, 445, 232" and I want to add a comma and a new
      number.


      Comment

      • Aggro

        #4
        Re: Append to a record

        Ondernemer wrote:
        [color=blue]
        > So how do you add "," + $var?
        >
        > e.g. a field has values "223, 445, 232" and I want to add a comma and a new
        > number.[/color]

        I gave you an url to the MySQL manual. I didn't give it just for the
        kicks, I gave it for you to read in case you have more questions.
        Please, if you don't read anything else, read about the concat() from
        it. If you still don't know the answer to your question after that,
        please ask again and I will answer.

        And sorry if I sound angry or scary. I'm only trying to teach you how to
        find answers to your questions by yourself, but that won't happen unless
        you try on your own ;)

        Comment

        Working...