I'm trying to make a smilie filter for my site, so that when someone times various commands such as [smile] [sad], the appropriate image will appear, but this code doesnt replace the string with the image at all:
function emoticon($string){
$querylist=mysql_query("select * from emoticon");
if ($querylist){
$count=mysql_num_rows($querylist);
if ($count > '0'){
for ($a=0; $a<$count; $a++){
$look=mysql_result($querylist, $a, 'content');
$subs=mysql_result($querylist, $a, 'image');
$string=eregi_replace("$look", "<img src='$subs'>", $string);
}
return $string; }}
}