well, as opposed to addslashes you should use mysql_real_escape_string and then stripslashes when you pull it out for editing.
UPDATE (assuming it's posted and the textarea name is newcontent)
$text = mysql_real_escape_string($_POST['newcontent']); $query="UPDATE table2 SET pagetext='$text' WHERE uid='5'"; mysql_query($query); echo "Record Updated"; mysql_close();
I would imagine you would have to load uid along with the text on the form and post it as a hidden field or something. You may want to look at nl2br maybe but I don't know if you will need that or not. If you are the only person using this then other measures in regards to security shouldn't be needed.
Looking at the varname 'pagetext' I wonder if you might just want to look into a premade CMS solution that will already allow all this.