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

Popular posts from this blog

java - Andrioid studio start fail: Fatal error initializing 'null' -

android - Gradle sync Error:Configuration with name 'default' not found -

StringGrid issue in Delphi XE8 firemonkey mobile app -