Forum FAQForum FAQSearchSearch MemberlistMemberlist Forum ignore listForum ignore list RegisterRegister ProfileProfile Log in to check your private messagesLog in to check your private messages Log inLog in
utf8 in mysql & "SET NAMES"?

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    mi3dot.org Forum Index -> Server-side
View previous topic :: View next topic  
Author Message
Sulien



Joined: 04 Jan 2004
Posts: 2905
Location: Zagreb

PostPosted: 03.03.2005 19:58    Post subject: utf8 in mysql & "SET NAMES"? Add user to your forum ignore list Reply with quote

Koristim (odnosno htio bih) utf8 u bazi. Namjestio sam default character set na utf8 i collation na utf8_general_ci

Problem nastaje kad vadim hrvatske znakove iz baze u php-u, dobijam upitnike a poziv character_set_name() kaže "latin1_swedish_ci" (!)

Vidio sam negdje da se stvar riješi sa queryem u skripti prije dohvata
Code:
$sql->query("SET NAMES 'utf8'");


To radi, ali meni se čini da ja nešto krivo radim kad mu moram svaki puta govoriti isto Confused

Opinions? Zyt? Smile
Back to top
View user's profile Send private message Send e-mail Visit poster's website
gog



Joined: 18 Jun 2004
Posts: 679
Location: zagreb

PostPosted: 03.03.2005 20:39    Post subject: Add user to your forum ignore list Reply with quote

Probaj unjeti
query-> SET character_set_client = 'utf8'; pa ćeš vidjeti da po novome imaš 3 vrste collationa, od servera, od baze i od konekcije, AFAIK.

Ukoliko nemaš pristup konfiguraciji servera samo nakon svake konekcije na bazu pošalji gore navedeni query i stvar riješena...
Back to top
View user's profile Send private message Visit poster's website
Sulien



Joined: 04 Jan 2004
Posts: 2905
Location: Zagreb

PostPosted: 04.03.2005 18:56    Post subject: Add user to your forum ignore list Reply with quote

gog wrote:
Probaj unjeti
query-> SET character_set_client = 'utf8'; pa ćeš vidjeti da po novome imaš 3 vrste collationa, od servera, od baze i od konekcije, AFAIK.

znači ovo što si rekao treba napraviti na razini baze? probat ću kad stignem

imam pristup konfiguraciji jer je moja baza Wink ali tamo gdje ću prenijeti podatke nisam admin
Back to top
View user's profile Send private message Send e-mail Visit poster's website
njava
mi3.crew


Joined: 25 Aug 2003
Posts: 624
Location: Zagreb

PostPosted: 05.03.2005 16:48    Post subject: Add user to your forum ignore list Reply with quote

mysql 4.1.x podrzava setiranje charseta na na nivou servera, baze, tablice i kolone (fielda)

http://dev.mysql.com/doc/mysql/en/charset-defaults.html
http://dev.mysql.com/doc/mysql/en/charset-database.html
http://dev.mysql.com/doc/mysql/en/charset-table.html
http://dev.mysql.com/doc/mysql/en/charset-column.html
http://dev.mysql.com/doc/mysql/en/charset-examples.html
Back to top
View user's profile Send private message Visit poster's website
gog



Joined: 18 Jun 2004
Posts: 679
Location: zagreb

PostPosted: 05.03.2005 17:27    Post subject: Add user to your forum ignore list Reply with quote

Sulien wrote:
gog wrote:
Probaj unjeti
query-> SET character_set_client = 'utf8'; pa ćeš vidjeti da po novome imaš 3 vrste collationa, od servera, od baze i od konekcije, AFAIK.

znači ovo što si rekao treba napraviti na razini baze? probat ću kad stignem

imam pristup konfiguraciji jer je moja baza Wink ali tamo gdje ću prenijeti podatke nisam admin


Sorry, krivu stvar sam pejstao, trebalo je pisati query -> SHOW variables like '%char%';
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    mi3dot.org Forum Index -> Server-side All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group