简体   繁体   English

pdo 在哪里不起作用?

[英]pdo where doesnt work?

im trying some sql on PDO but returning null.我在 PDO 上尝试了一些 sql 但返回 null。 Because i have "ı" character on sqlserver table.因为我在 sqlserver 表上有“ı”字符。

for example;例如;

i have "carsname" row on sql table, im trying get this data我在 sql 表上有“carsname”行,我正在尝试获取此数据

SELECT * FROM cars WHERE carsname='ııı'

I have a data with name ııı, but the result is null.我有一个名为 ııı 的数据,但结果为空。 how can i fix?我该如何解决? any help pls.任何帮助请。

You need to use a compatible encoding on both the table and the client connection.您需要在表和客户端连接上使用兼容的编码。 Ensure your table is using utf8mb4 and your PDO connection is also by specifying the charset in the connection string, ie charset=utf8mb4 .确保您的表使用utf8mb4并且您的 PDO 连接也是通过在连接字符串中指定字符集,即charset=utf8mb4

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM