とにかくUNICODEに
4.3.9
mysqladmin version
mysqladmin Ver 8.41 Distrib 4.1.22, for redhat–linux–gnu on i386
Server version | 4.1.22 |
Protocol version | 10 |
Connection | Localhost via UNIX socket |
UNIX socket | /var/lib/mysql/mysql.sock |
- :::現在の文字セット:::::
mysql>SHOW VARIABLES LIKE ‘char%’;
Variable_name | Value |
character_set_client | utf8 |
character_set_connection | utf8 |
character_set_database | utf8 |
character_set_results | utf8 |
character_set_server | utf8 |
character_set_system | utf8 |
character_sets_dir | /usr/share/mysql/charsets/ |
上記の状態でmysqlから抽出したデータの日本語部分が?????に化ける。
↓
下記の一文を挿入して解決
$con = mysql_connect($DBSERVER, $DBUSER, $DBPASSWORD)or die(“Could not connect\n”);
$select_db = mysql_select_db($DBNAME)or die (“Could not select\n”);
$sql = “select * from table”;
$alt = mysql_query(“set names utf8”,$con);
$rst = mysql_query($sql,$con);
http://phpspot.net/php/pgMySQL4.1%8CnUTF-8%82%CC%8F%EA%8D%87.html
http://www.res-system.com/weblog/item/467
http://www.artful.jp/blog/archives/2006/07/xamppmysqlphpmy.html
http://tod.cocolog-nifty.com/diary/2005/12/xamppphpmysql_6279.html
http://blog.cheki.net/archives/349
MANAUSの河岸で暮らす人
コメントを残す