This worked fine except in situations where the original contents of the field is null. Then in what I consider an unintuitive move concat returns a null. This could be disastrous, in a case where the existing update has no data in a particular text field it wipes the existing data already stored. Is there any way of preventing this?
Charlie -----Original Message----- From: Charlie Markwick Sent: 15 November 2007 17:58 To: '[email protected]' Subject: RE: [php_mysql] Cumulative inserts Yes I can see it now many many thanks:- update Maintable set Notes=concat(Notes,$DateandUserLine) where ID=$ID Charlie -----Original Message----- From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Charlie Markwick Sent: 15 November 2007 17:49 To: [email protected] Subject: RE: [php_mysql] Cumulative inserts Marius Ok, thanks for getting back to me so quickly, that looks interesting. Is there any way of using directly on an insert statement or would I still have to select the contents of the field I want to add to first? Charlie -----Original Message----- From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Marius Bocean Sent: 15 November 2007 14:47 To: [email protected] Subject: Re: [php_mysql] Cumulative inserts no, you can use CONCAT in mysql, if i understand what you are saying. hth, t ----- Original Message ----- From: Charlie Markwick To: [email protected] Sent: Thursday, November 15, 2007 11:23 AM Subject: [php_mysql] Cumulative inserts When doing an insert into a text field is there a way of inserting text on a cumulative basis. In other words do I always have to get the contents add the new text to it and then write the contents back as a whole? The php_mysql group is dedicated to learn more about the PHP/MySQL web database possibilities through group learning. Yahoo! Groups Links
