2010-07-03, 01:57 AM
Hey
Im just trying to have the latest threads show up outside the forum on my main site.
So im doing a simple mysql_select and pulling the latest threads. All OK.
But for some strange reason, the special chars in users usernames are showing up as "??"
for example..
[TJ] ~ H??dC�??
But, when i directly look into the database, i see the username been stored as it should be correctly, [TJ] ~ HᵰяdCøяє.
the database is set to UTF8 and the page im outputting to is UTF8.
So im really confused, if mybb can display the username correctly, why carnt i show it correctly outside the forum? What am i missing?
Its the $lastposter var thats showing wierd characters. As said, its correct in the database and shows fine within mybb... but just shows wierd characters when i try show it outside mybb.. any help?
Im just trying to have the latest threads show up outside the forum on my main site.
So im doing a simple mysql_select and pulling the latest threads. All OK.
But for some strange reason, the special chars in users usernames are showing up as "??"
for example..
[TJ] ~ H??dC�??
But, when i directly look into the database, i see the username been stored as it should be correctly, [TJ] ~ HᵰяdCøяє.
the database is set to UTF8 and the page im outputting to is UTF8.
So im really confused, if mybb can display the username correctly, why carnt i show it correctly outside the forum? What am i missing?
$result = mysql_query("SELECT * FROM `mybb_threads` WHERE `fid` = '5' OR `fid` = '2' OR `fid` = '11' ORDER BY tid DESC LIMIT 8");
while ($row = mysql_fetch_assoc($result)) {
$subject = $row['subject'];
$tid = $row['tid'];
$lastposter = $row['lastposter'];
echo "<li><img src=\"http://www.8baller.co.uk/forum/images-8baller/jump.gif\" style=\"vertical-align:middle;\"><a href=\"http://www.8baller.co.uk/forum/thread-$tid.html\" title=\"$subject\">$subject</a> $lastposter</li>";
}
Its the $lastposter var thats showing wierd characters. As said, its correct in the database and shows fine within mybb... but just shows wierd characters when i try show it outside mybb.. any help?