vaiiii Posted August 16, 2009 Report Share Posted August 16, 2009 tatad es meginu ielikt utf8 datubaze, db ir utf8_general_ci, tabulas ari. kad es ielieku ā man rāda phpmyadmin Ä bet ja es ielieku caur phpmyadmin ā tad man rāda phpmyadminā to garo ā pareizi, bet skriptā rāda ?, mb_detect strings rāda, ka caur phpmyadmin ieliktais ir ASCII bet caur skriptu UTF8, vai tā ir phpmyadmin vaina ka nerāda pareizi burtus? es nekā vairāk nevaru uztaisīt export db, jo viss kas ir utf8 tagad ir keburi. skripta enkodings ir ANSI as UTF-8 (UTF-8 without BOM) ar php,db nemos jau vairak ka gadu, nekad nebij tadas problemas man, jau meginaju mainit ekodingus , bet tapat nekaa.. uz otra pc, ari tada pati problema.. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <? mysql_connect('localhost','root','root3v45v'); mysql_select_db('fcuk'); mysql_query("INSERT INTO fcuk(fcuk) VALUES('ā')"); $a = mysql_query("SELECT * FROM fcuk"); if (!$a){echo mysql_error();die();} while ($c = mysql_fetch_assoc($a)){ echo mb_detect_encoding($c['fcuk']).' '.$c['fcuk'].'<br>'; } ?> DB: CREATE TABLE `fcuk` ( `fcuk` varchar(43) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8; Quote Link to comment Share on other sites More sharing options...
waplet Posted August 16, 2009 Report Share Posted August 16, 2009 pirms visiem pārējiem kveriejiem izdari šādi gan pirms izvadīšas gan pie ievadīšanas mysql_query)("SET NAMES UTF8 COLLATE utf8_general_ci"); Quote Link to comment Share on other sites More sharing options...
vaiiii Posted August 16, 2009 Author Report Share Posted August 16, 2009 tagad strādā, bet katru reizi izmantot to kveriju, nedomaju ka ir labi, jo tas lieki noslogo serveri, varbut konfigā kaut ko mainīt? Quote Link to comment Share on other sites More sharing options...
waplet Posted August 16, 2009 Report Share Posted August 16, 2009 tikai pēc connecta vienreiz un viss Quote Link to comment Share on other sites More sharing options...
bubu Posted August 16, 2009 Report Share Posted August 16, 2009 Konfigā arī var mainīt. MySQL servera my.cnf failā ieraksti: default-character-set=utf8 (zem [client] sadaļas) Tad nevajadzēs vairs to set names izpildīt. Quote Link to comment Share on other sites More sharing options...
vaiiii Posted August 16, 2009 Author Report Share Posted August 16, 2009 nestrada bez tas rindas tapat.. varbut vel kaut ko vajag savadak konfiguret? Quote Link to comment Share on other sites More sharing options...
bubu Posted August 16, 2009 Report Share Posted August 16, 2009 Tev tas SET NAMES jādara gan pie datu ielikšanas, gan pie datu izvilkšanas no DB. Kā arī pārliecinies, ka php skripts, kurā ir tas "ā" burts, ir ieseivots UTF-8 kodējumā. Quote Link to comment Share on other sites More sharing options...
vaiiii Posted August 16, 2009 Author Report Share Posted August 16, 2009 to es saprotu, bet kā panākt lai nevajag to query katru reizi taisīt default-character-set=utf8 +rr neko nemainiija, tik un ta bez tas kverijas nevar normali ielikt datus. Quote Link to comment Share on other sites More sharing options...
vaiiii Posted August 16, 2009 Author Report Share Posted August 16, 2009 (edited) te var redzet ka sakonfigurets! es domaju ka vajadzetu iet bez tas kverijas, bet tapat nevienojas normali.. Edited August 16, 2009 by vaiiii Quote Link to comment Share on other sites More sharing options...
Wuu Posted August 25, 2009 Report Share Posted August 25, 2009 Kā ir pareizi ? mysql_query("set names 'utf-8'"); mysql_query("set names utf-8"); mysql_query("set names 'utf8'"); mysql_query("set names utf8"); Galvenais ka katrs kaut kā savādāk strādā Quote Link to comment Share on other sites More sharing options...
waplet Posted August 25, 2009 Report Share Posted August 25, 2009 pēdējais Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.