MyBB Community Forums

Full Version: Problem while fetching from the DB
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey there.

I've already done successfully the same thing with MyBB 1.2. I'm trying to fetch text fields from the forum DB, and it returns question marks ("?") (it's Hebrew text and the database's tables are UTF-8). I tried to look in the phpMyAdmin, and found that the Hebrew text is shown as it is, while it's supposed to be gibberish, and when I fetch it, it "becomes" the real string.
Well, I really don't know what the problem is. First I thought that the format of the tables is not good, but I didn't succeed to do anything. Any suggestions?

Thanks (:
What are you trying to fetch them for?? A plugin??
When displaying the characters on the page, have you tried using the htmlspecialchars_uni($var) function?
(2009-03-24, 12:57 PM)MattRogowski Wrote: [ -> ]What are you trying to fetch them for?? A plugin??
Not for a plugin. I need to show the text in my website.

(2009-03-24, 01:20 PM)Tomm M Wrote: [ -> ]When displaying the characters on the page, have you tried using the htmlspecialchars_uni($var) function?
Yes, I included /inc/functions.php file, and used htmlspecialchars_uni($var). Did not make any changes.

Thanks again (:
Hmm, not too sure... I personally would look at why it's being put into the database as hebrew text, and not unicode.

Otherwise, you could do something crazy, like get the text from the database, convert it to unicode, then display the conversion. Mind's drawn a blank at the minute, but you could try using PHP's htmlspecialchars with a different character set...
Hmm.. I did it somehow.
Thanks anyway Smile