English 中文(简体)
PHP question on encoding (latin1_swedish_ci vs utf8_unicode_ci)
原标题:PHP question on encoding (latin1_swedish_ci vs utf8_unicode_ci)

我有一个关于编码的问题。 在我的MySQL数据库中,我把用户编为 la1_swedish_ci(坏账)。 现在,我把我的应用程序与Facebook连接起来,并检索朋友名单。 我希望看到我的申请中是否已有这些朋友。 可悲的是,当我试图回答提问时,我会发现这一错误:

#1267 - Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_unicode_ci,COERCIBLE) for operation  like  

因此,基本上,我试图把Facebook朋友的名字(图8)与我的Dabatase(latin1)。

我不想把整个数据库移至utf8,我很想知道,在PHP中,能否核实名字编码是否符合第1条,或者至少可能把所有名字编为“ la1”和进行盘问,甚至仅仅抽取名字。

Does anyone of you know if it s possible to do something like this? Thanks,

Masiar

最佳回答

不完全确定你如何通过搜索箱或某种东西来寻找朋友? 政策手册的作用是什么?

但我认为,你可以通过在连接你的数据库时具体说明特征和串通来解决这一问题。 顺便说一句,我假定你正在使用MySQL。

每次你建立非行联系时,都会提出以下3个问题,尽管我认为,头2个问题可能就足够了。

SET character_set_connection = utf8
SET character_set_client = utf8
SET character_set_results = utf8
问题回答

暂无回答




相关问题
Brute-force/DoS prevention in PHP [closed]

I am trying to write a script to prevent brute-force login attempts in a website I m building. The logic goes something like this: User sends login information. Check if username and password is ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

定值美元

如何确认来自正确来源的数字。

Generating a drop down list of timezones with PHP

Most sites need some way to show the dates on the site in the users preferred timezone. Below are two lists that I found and then one method using the built in PHP DateTime class in PHP 5. I need ...

Text as watermarking in PHP

I want to create text as a watermark for an image. the water mark should have the following properties front: Impact color: white opacity: 31% Font style: regular, bold Bevel and Emboss size: 30 ...

How does php cast boolean variables?

How does php cast boolean variables? I was trying to save a boolean value to an array: $result["Users"]["is_login"] = true; but when I use debug the is_login value is blank. and when I do ...

热门标签