MySQL Lists are EOL. Please join:

List:General Discussion« Previous MessageNext Message »
From:Mr Orange Date:March 20 2003 1:50am
Subject:Re: appending to longtext field
View as plain text  
GV wrote:
> I think is better to have an additional record each time a user
> inserts
> new information
> Mr Orange wrote:
>> Hello all,
>> I have a database with a type "longtext" called "notes".
>> Say I wanted to append some text to this field, what command would I
>> use?
>> I have tried the following sql..
>>   update clients set notes=notes+"text to append" where id=1;
>> But this doesn't seem to do the job.
>> I am new to MySQL so sorry if I've asked an obvious question!
>> Many thanks in advance,
>> Steve.
>> PS.  What is needed is a database to store notes on each client
>> which can be added to as necessary.  If anyone has a better idea of
>> a way to do this, I'd be very grateful for any help!  Cheers.

Hi GV,

What do you mean by adding an additional record?

At the moment, say I have a table set up as follows:
  id int(6) not null auto_increment,
  notes longtext,

I have no idea at the beginning how many notes a user will enter on a
particular client, so how would I create the table?  Obviously I
couldn't have,
  int int(6) not null auto_increment,
  note1 longtext,
  note2 longtext, etc.

Is it possible to create a 'dynamic' table where the fields in there could
grow to accomodate any inputted notes?

If you could offer any help on this, by way of email, or links to webpages
or whatever, I'd be really grateful,


Mr O.

appending to longtext fieldMr Orange19 Mar
  • Re: appending to longtext fieldGV19 Mar
  • Re: appending to longtext fieldMr Orange20 Mar
    • Re: appending to longtext fieldJeff Shapiro20 Mar