Jump to content

strtr using mysql_fetch_array


maxudaskin

Recommended Posts

I have a database with all of my smilies for my forum, and I was wondering why it did this...

upl6446614026.jpg

Database

 

upl3825429063.jpg

Error...

 

The real post is This is some sample text inserted under OOM0100 Michael Bonanno's name. (second post)

	  $topicid       = $_GET['t'];
  $namesql       = mysql_query("SELECT * FROM forum_posts WHERE topicid = '{$topicid}'");
  $postsql       = mysql_query("SELECT * FROM forum_posts WHERE topicid = '{$topicid}'");
  $smilies_query = mysql_query("SELECT * FROM smilies");
  $smilies_array = mysql_fetch_array($smilies_query);
  while($namerow = mysql_fetch_array($namesql)){
  define('name',$namerow['title']);
  }
  ?>
  <table style="border-top:1px #FFFFFF solid" width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td height="20" colspan="2" bgcolor="#333355"><span class="style26"> <?php echo constant('name'); ?></span></td>
        </tr>
	<?php
	while($posts = mysql_fetch_array($postsql)){
	?>
        <tr>
          <td width="17%" rowspan="3" valign="top" nowrap="nowrap" bgcolor="#EFF4FB"  style="border-bottom:1px #333355 solid; border-right: 1px #333355 solid; padding-left:5px;"><br />
            OOM<?php echo $posts['pid']; ?><br />
            <?php echo $posts['name']; ?><br />
            <br />
            --- Hours<br />
            [php Rank]<br />
            [php Position]<br />
            <br />              
            <br />            </td>
          <td width="83%" height="15" valign="top" bgcolor="#F6F6F6" style="padding-left:5px">
	  <?php
	  echo '<em>Posted on '.$posts['date'].' at '. $posts['time'] .'</em>';
	  ?></td>
        </tr>
        <tr>
          <td valign="top" style="padding-left:5px; padding-top:3px;" bgcolor="#FFFFFF"><?php echo strtr($posts['text'],$smilies_array); $smilies_array; ?></td>
        </tr>
        <tr>
          <td height="39" bgcolor="#FFFFFF" style="border-bottom:1px #333355 solid; padding-left:5px;">Signature </td>
        </tr>
	<?php } ?>
      </table>	

 

 

I made it echo the implode of the array and this is what is said: ../comm/smilies/smile.gif../comm/smilies/smile.gif[smile][smile]:):)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.