0

Hello all.

I have a bit of a problem.

I have a few php pages all encoded utf-8.
A MySQL database, where it is possible to have characters like: 'á'é'ú'ő'ü' and so on, i have set with phpmyadmin to be utf8_hungarian_ci character encoding.

Funny thing is, that when I write data back from table with query to webpage, everything is fine.

The problem is, that in php it looks bad, and i would like to change that.

like Háztartási gép should be Háztartási gép.

Thanks for the help.

2
Contributors
7
Replies
8
Views
5 Years
Discussion Span
Last Post by diafol
0
$link = mysql_connect('...', '...', '...');
if (!$link) {
    die('Not connected : ' . mysql_error());
}
// make foo the current db
$db_selected = mysql_select_db('...', $link);
if (!$db_selected) {
    die ('Can\'t use ... : '. mysql_error());
}
	mysql_query('SET character_set_results=utf8');
	mysql_query('SET names=utf8');
	mysql_query('SET character_set_client=utf8');
	mysql_query('SET character_set_connection=utf8');
	mysql_query('SET character_set_results=utf8');
	mysql_query('SET collation_connection=utf8_unicode_ci');

How about setting to utf-8_unicode_ci?

0
$link = mysql_connect('...', '...', '...');
if (!$link) {
    die('Not connected : ' . mysql_error());
}
// make foo the current db
$db_selected = mysql_select_db('...', $link);
if (!$db_selected) {
    die ('Can\'t use ... : '. mysql_error());
}
	mysql_query('SET character_set_results=utf8');
	mysql_query('SET names=utf8');
	mysql_query('SET character_set_client=utf8');
	mysql_query('SET character_set_connection=utf8');
	mysql_query('SET character_set_results=utf8');
	mysql_query('SET collation_connection=utf8_unicode_ci');

How about setting to utf-8_unicode_ci?

Okey here is what i have now:

character_set_client utf8
character_set_connection utf8
character_set_database utf8
character_set_filesystem binary
character_set_results utf8
character_set_server latin1
character_set_system utf8
character_sets_dir /usr/share/mysql/charsets/


collation_connection utf8_unicode_ci
collation_database utf8_hungarian_ci
collation_server latin1_general_ci

as i can see, everything is utf8. And yet I still only see broken characters in phpmyadmin
could it simply be that character_set_server should be changed to utf-8?

Edited by Psyho: n/a

0

You can change the collation and character set within phpmyadmin

0

You can change the collation and character set within phpmyadmin

on the database as a whole i have given the collation utf8_general_ci.

nothing changes.

0

Did you try my settings?

Sorry for being such a dunderhead.

I thought i did it, but lost connection with server while waiting for it to be uploaded.
I quite forgot that I have only 3 minutes of connection to the server at any time.

Now i have uploaded (checked and double checked it) and it works.

So thank you for everything.

But I wonder if I could ask another question as well?
I need an aoutomatic mail sender. One that sends a letter to the winner of an auction, at the moment auction is over? It has to be completely from server-side, so even if no-one visits the page for weeks, the letters will still be sent.

Is it possible?

0

If you need a 'triggerless' script run, look at cron jobs. A cron job will run a script at a preset time and date.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.