Well if you're looking for the least server load, skip the database.
- Make a separate file that contains one associative array. The items in this array will look something like this:
aSmileys = array("🙂"=>"smile1.gif", ";-)"=>"smile2.gif", ":-("=>"frown1.gif");
And so on.
Include this file wherever you need to translate smileys. You could translate the smileys when they post so the IMG tags are in the database, or you can translate the smileys when it is being displayed (meaning the ASCII smileys are in the database).
Loop through the array wherever you need to, replacing the key string for the value (surrounded by the IMG tag). Say you want to translate upon display and the body of the message is in $get['body']:
include "arrayFile.php";
$newStr = $get['body'];
$arrCnt = count($aSmileys);
while (list($key, $val) = each($aSmileys))
$newStr = str_replace($key, $val, $newStr);
echo $newStr;
Hope that helps! I would actually store the ASCII smiley in the database and translate upon display, just in case you want to change the IMG tag in the future (if you move directories or change from GIF to JPG or something, for example).