$comment = addslashes($_POST['comment']);
$comment = ereg_replace( ":)","<img src=guestbook_images/smiley1.gif border=0>",$_POST['comment']);
$comment = ereg_replace( ":P","<img src=guestbook_images/smiley2.gif border=0>",$comment);
Just add another line beneath it. 🙂 The variable will overwrite itself with the new content.
You should also implement some type of variable protection to protect from SQL Injection. That's what the addslashes() function is for. But if you do that, you'll have to remember to use the stripslashes() function when displaying your code. 😉