prepend data to field

This is a discussion on prepend data to field within the PHP Language forums, part of the PHP Programming Forums category; I have a record in a MySql database which can be edited. Each time it is edited I want to ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-26-2007
Geoff Berrow
 
Posts: n/a
Default prepend data to field

I have a record in a MySql database which can be edited. Each time it
is edited I want to give the user the opportunity to summarise the
changes, which I store in a field. It doesn't really warrant another
table it would be sufficient to prepend the data to the existing data in
the field.

Sorry if this is really a MySql problem, but at the moment I can only
think of a php/html hidden field solution.
--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Reply With Quote
  #2 (permalink)  
Old 04-26-2007
Rik
 
Posts: n/a
Default Re: prepend data to field

Geoff Berrow wrote:
> I have a record in a MySql database which can be edited. Each time it
> is edited I want to give the user the opportunity to summarise the
> changes, which I store in a field. It doesn't really warrant another
> table it would be sufficient to prepend the data to the existing data in
> the field.
>
> Sorry if this is really a MySql problem, but at the moment I can only
> think of a php/html hidden field solution.


Why does it have to be hidden?

Maybe you're looking for something simple like:

HTML:
<textarea name="new_comments"></textarea>

SQL:
UPDATE `tablename` SET `comments` =
CONCAT('{$_POST['new_comments']}','\n',`comments`) WHERE #your clause...

HTH,
--
Rik Wasmus

Estimated date being able to walk again: 01-05-2007.
Less then a week, hurray!
Reply With Quote
  #3 (permalink)  
Old 04-26-2007
Steve
 
Posts: n/a
Default Re: prepend data to field

| --
| Rik Wasmus
|
| Estimated date being able to walk again: 01-05-2007.
| Less then a week, hurray!

less than a week? what happened, rik?


Reply With Quote
  #4 (permalink)  
Old 04-26-2007
Rik
 
Posts: n/a
Default Re: prepend data to field

Steve wrote:
> | Estimated date being able to walk again: 01-05-2007.
> | Less then a week, hurray!
>
> less than a week? what happened, rik?


I made a brave effort to clean the raingutters on the third floor.
Unfortunately, the ladder did not agree with me, so I took about a 9
meter tumble. Both legs broken, so I'm temporarily in a wheel chair. Sad
thing was I live on the forementioned third floor, and the house did not
have any lifts...

Well, that's about 6 weeks ago, the casts come off come tuesday, and
then we'll check wether the walking is an option. Would be nice, to be
able to work with my normal dualcore AMD souped up machines again,
instead of this ancient laptop. It's got some unfixable harddisk
problems, which mean every time you save a file it's a bit of a gamble
wether it will actually be retrievable later. Oh joy :-)

--
Rik Wasmus

Estimated date being able to walk again: 01-05-2007.
Less then a week, hurray!
Reply With Quote
  #5 (permalink)  
Old 04-27-2007
Steve
 
Posts: n/a
Default Re: prepend data to field


"Rik" <luiheidsgoeroe@hotmail.com> wrote in message
news:f0qvbk$ssg$1@news5.zwoll1.ov.home.nl...
| Steve wrote:
| > | Estimated date being able to walk again: 01-05-2007.
| > | Less then a week, hurray!
| >
| > less than a week? what happened, rik?
|
| I made a brave effort to clean the raingutters on the third floor.
| Unfortunately, the ladder did not agree with me, so I took about a 9
| meter tumble. Both legs broken, so I'm temporarily in a wheel chair. Sad
| thing was I live on the forementioned third floor, and the house did not
| have any lifts...

good god! so, you heft'd yourself up to the third floor with casts in tow
and stayed up there six weeks?!

| Well, that's about 6 weeks ago, the casts come off come tuesday, and
| then we'll check wether the walking is an option. Would be nice, to be
| able to work with my normal dualcore AMD souped up machines again,
| instead of this ancient laptop. It's got some unfixable harddisk
| problems, which mean every time you save a file it's a bit of a gamble
| wether it will actually be retrievable later. Oh joy :-)

so a wap and shared drive on your home lan wasn't an option? ;^) i know what
you mean though. i'm glad work keeps giving me new ones. the last one i
bought was a 386 32mb ram with a whopping 200mb hd. i took win98 off of it
and put knopix on to see if i could use it for anything...unless i
command-lined, xwindows blew just as hard. i actually gave it away to my
neighbor two weeks ago...ne'r a tear was shed.

best wishes on a speedy and full recover.


Reply With Quote
  #6 (permalink)  
Old 04-27-2007
Geoff Berrow
 
Posts: n/a
Default Re: prepend data to field

Message-ID: <f0qnbg$ue5$1@news6.zwoll1.ov.home.nl> from Rik contained
the following:

>SQL:
>UPDATE `tablename` SET `comments` =
>CONCAT('{$_POST['new_comments']}','\n',`comments`) WHERE #your clause...


Thanks Rik, that's what I need.

--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Reply With Quote
  #7 (permalink)  
Old 04-27-2007
Jerry Stuckle
 
Posts: n/a
Default Re: prepend data to field

Rik wrote:
> Steve wrote:
>> | Estimated date being able to walk again: 01-05-2007.
>> | Less then a week, hurray!
>>
>> less than a week? what happened, rik?

>
> I made a brave effort to clean the raingutters on the third floor.
> Unfortunately, the ladder did not agree with me, so I took about a 9
> meter tumble. Both legs broken, so I'm temporarily in a wheel chair. Sad
> thing was I live on the forementioned third floor, and the house did not
> have any lifts...
>
> Well, that's about 6 weeks ago, the casts come off come tuesday, and
> then we'll check wether the walking is an option. Would be nice, to be
> able to work with my normal dualcore AMD souped up machines again,
> instead of this ancient laptop. It's got some unfixable harddisk
> problems, which mean every time you save a file it's a bit of a gamble
> wether it will actually be retrievable later. Oh joy :-)
>


Wow - sorry to hear about you accident, Rik. But it sounds like you're
coming along ok.

I suspect you'll be a little wobbly for a while until you get the
strength back in your lets, but I know you'll be happy to get those
casts off!


--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 06:14 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0