RE: [PHP-DB] appending new entry to old entries

From: Date: Thu, 18 Apr 2002 15:52:15 +0000
Subject: RE: [PHP-DB] appending new entry to old entries
Groups: php.db 
Request: Send a blank email to php-db+get-18646@lists.php.net to get a copy of this message
Not sure if you're asking whether you can append info onto the end of a database field without having to get the previous information, but you can. UPDATE table SET MyField=CONCAT(MyField,'Appended Text') WHERE Some_ID=5; That would update the row identified by Some_ID = 5, and append "Appended Text" to the end of MyField without a query to get the previous values. For numeric fields, you can also increment them like this: UPDATE table SET MyNumericField = MyNumericField + 1; That would update all rows in table, incrementing every row's MyNumericField value by 1. - Jonathan -----Original Message----- From: Jason Wong [mailto:phplist@gremlins.com.hk] Sent: Thursday, April 18, 2002 2:27 AM To: php-db@lists.php.net Subject: Re: [PHP-DB] appending new entry to old entries On Thursday 18 April 2002 16:51, Ron Allen wrote: > I would like to make it so that my helpdesk section can append entries in > their Master Station Log. Update replaces the entry....any clues?????? You would have to get the original value, append the new stuff then do UPDATE. -- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * /* There is very little future in being right when your boss is wrong. */ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.db (#18646) next »