MDanz Posted September 2, 2009 Share Posted September 2, 2009 This is the code to show an avatar from a user. mysql_connect("localhost", "Master", "password"); mysql_select_db("Login"); $avatar = mysql_fetch_assoc(mysql_query("SELECT * FROM Users))or die (mysql_error()); $image = $avatar['image']; Below is how a reply is echoed. I don't know how to implement my avatar into this because it is saved in a different table. I tried applying image field as an avatar as you can see below, but you have to reply before you can set an avatar(because if you didn't there would be no record)... so i changed image field to User Table above. How do i take the image(avatar from that username above and send it to this code below.. while ($runrows = mysql_fetch_assoc($run)){ $id = $runrows['id']; $username1 = $runrows['username']; $image = $runrows['image']; $posted= $runrows['posted']; $reply = str_replace ("\r\n", '<br />',$runrows['reply']); echo '<td><tr>'; echo "</tr><font color=white><strong>[b]<img src='$image' width='50px' height='50px'>[/b] $username1 - $reply <a href='report.php?id=$id'><img src='http://www.usdad.com/report.jpg'></a></center><br><br><hr size='1'></strong></font></td>"; } echo '</tab if there is an easier way please let me know. the image is already stored in the first bit of code, just echoing it out with the reply is what i'm having trouble on. Link to comment https://forums.phpfreaks.com/topic/172810-avatar-help/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.