Germaris Posted August 7, 2007 Share Posted August 7, 2007 Hi there! I wish to update the content of a field but WITHOUT erasing its existing content. New content needs to be added to the existing one. Each chunk separated by a line break. How should I write the query? Many thanks in advance for any help! Quote Link to comment Share on other sites More sharing options...
NArc0t1c Posted August 7, 2007 Share Posted August 7, 2007 mysql_query("UPDATE table SET field=field.$other"); Not quite sure if that will work but you could try. Quote Link to comment Share on other sites More sharing options...
Germaris Posted August 7, 2007 Author Share Posted August 7, 2007 Sorry it doesn't work... Thanks anyway for replying! Quote Link to comment Share on other sites More sharing options...
NArc0t1c Posted August 7, 2007 Share Posted August 7, 2007 Try: $contents = mysql_query("SELECT field FROM table"); $data = $new_data . $contents; mysql_query("UPDATE table SET field='$data'"); [code] [/code] Quote Link to comment Share on other sites More sharing options...
Germaris Posted August 7, 2007 Author Share Posted August 7, 2007 Good Job !!! This one works fine. Many thanks for this valuable help. Best regards, Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.