Dimitris Sapikas
Dimitris Sapikas

Reputation: 622

mysql collation is fine for phpmyadmin but not for sql

i am having a database where i store both greek and english strings using collations : "greek_general_ci" and "utf8_general_ci" from phpmyadmin everything works fine ! but using mysql comand from terminal, or mysql_query from php i get some "?", do you have any idea why this happends ? in the meanwhile everything is fine from phpmyadmin !

i have to note that i need sometimes to use english , so a collation that supports only greek may not be much helpful, but i believe that it is not matter of the collation

also i have to say that i use this in my html to display greek characters :

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

thank you

Upvotes: 0

Views: 292

Answers (1)

Eugen Rieck
Eugen Rieck

Reputation: 65342

First of all: You are barking up the wrong tree. Your problem is not collation (or you have not yet found out so), but encoding.

  • in the tables
  • on your connection

I recommend you start debugging by putting a query like SET NAMES 'UTF8' at the start of your PHP scripts. Quite likely, this will make the immediate problem "go away", giving you a foot in the door for a more permanent fix.

Upvotes: 1

Related Questions