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! Link to comment https://forums.phpfreaks.com/topic/63707-solved-updating-the-content-of-a-field/ 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. Link to comment https://forums.phpfreaks.com/topic/63707-solved-updating-the-content-of-a-field/#findComment-317466 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! Link to comment https://forums.phpfreaks.com/topic/63707-solved-updating-the-content-of-a-field/#findComment-317475 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] Link to comment https://forums.phpfreaks.com/topic/63707-solved-updating-the-content-of-a-field/#findComment-317700 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, Link to comment https://forums.phpfreaks.com/topic/63707-solved-updating-the-content-of-a-field/#findComment-317753 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.