PHP Replace Emoticon from MySQL Can't looping -
i have problem syntax coding emoticon. can replaced in first post, in next post can't replaced. not looping well.
you can see images in:
http://postimg.org/image/srph22j8d/
# populated emoticon $sqlemo = "select * apprtcfg obj_typ = 'emo' order id asc;"; $queryemo = mysql_query($sqlemo); while ($rsltemo=mysql_fetch_array($queryemo)) { $emo_code = $rsltemo['obj_link']; $emo_img = $rsltemo['obj_source']; } echo $content = str_replace($emo_code,'<img src="image/'.$emo_img.'">', $row['content']);
you should replace emotions images, inside while , echo after end of while.
$sqlemo = "select * apprtcfg obj_typ = 'emo' order id asc;"; $queryemo = mysql_query($sqlemo); $content = $row['content']; while ($rsltemo=mysql_fetch_array($queryemo)) { $emo_code = $rsltemo['obj_link']; $emo_img = $rsltemo['obj_source']; $content = str_replace($emo_code,'<img src="image/'.$emo_img.'">', $content); } echo $content;
Comments
Post a Comment