Jump to content

Greek shows as ??? when getting data from database


alejandro52

Recommended Posts

try setting it to utf8_* (like utf8_unicode_ci) and it might solve your problems...

 

it may be HTML problem (i don't think though) so before you do that

try setting:

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

Link to comment
Share on other sites

if you followed my instructions in my other post, the other thread

you need nothing extra, sql comes built in for greek support (utf-8 support)

 

if you are using windows, you need to have greek fonts added, go to regional settings, make sure greek is selected as an installed language

 

 

but i suspect it is not because of that, did you set the connection for mysql to utf-8 ???

and did you save you php file in utf-8, there were a bunch of steps in my thread that I linked

did you follow it???

Link to comment
Share on other sites

I tried all the steps but nothing happened. Except this one 2. the connection to your database must be in that charset with the SET NAMES code. When i connect to the database i have

 

	$query = 'SELECT * FROM erotiseis ORDER BY id DESC';

$result = mysql_query($query) or die('Query failed: ' . mysql_error());

 

how should i change it to do the step you said

Link to comment
Share on other sites

it is like this:

 

$connect = mysql_connect("address", "name", "password") or 
                   die ("Hey loser, check your server connection.");
mysql_select_db("mysql_name", $connect);

$sql = "SET NAMES utf8 COLLATE utf8_bin";
mysql_query($sql) or die(mysql_error());

$query = 'SELECT * FROM erotiseis ORDER BY id DESC';

$result = mysql_query($query) or die('Query failed: ' . mysql_error());

 

once you SET NAMES, basically this means this connection now sends data to and from mysql in utf-8 charset, you can run as many queries as you want after that, you only have to SET NAMES once after you connect to the database

Link to comment
Share on other sites

glad you solved it :) I had a mess of problems before that led me to enlightenment on such subjects of language universal support

 

So I try to spread the knowledge :)

 

-mark Topic Solved if the topic is solved also

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.