the following doesn't works, how can I search in data which stored in Arabic
以下不起作用,我如何搜索存储在阿拉伯语中的数据
SELECT * FROM `users` WHERE `name` LIKE = "%شريف%"
that gave me Error sql query
那给了我错误的SQL查询
4 个解决方案
#1
5
Use:
SELECT * FROM `users` WHERE `name` LIKE "%شريف%"
#2
3
This has nothing to do with the language or character set being used. It's a simple syntax error.
这与使用的语言或字符集无关。这是一个简单的语法错误。
To put it simply, don't use LIKE
and =
together. Use one or the other. I guess you mean LIKE
in this case, so remove the =
and your query will work.
简单地说,不要一起使用LIKE和=。使用其中一个。我想你的意思是LIKE在这种情况下,所以删除=,你的查询将工作。
#3
0
In your query you don't write = operator or LIKE keyword at a same time
在查询中,您不会同时写入=运算符或LIKE关键字
- If you want to use LIKE keyword then follow the below query
如果要使用LIKE关键字,请按照以下查询
SELECT * FROM `users` WHERE `name` LIKE "%شريف%"
- If you want to use = operator then follow the below query
如果要使用=运算符,请按照以下查询
SELECT * FROM `users` WHERE `name` = "شريف"
#4
0
Try the following command for searching Arabic data use:
尝试以下命令搜索阿拉伯数据使用:
SELECT * FROM `users` WHERE MATCH(`name`) AGAINST('شريف' in Boolean Mode);
#1
5
Use:
SELECT * FROM `users` WHERE `name` LIKE "%شريف%"
#2
3
This has nothing to do with the language or character set being used. It's a simple syntax error.
这与使用的语言或字符集无关。这是一个简单的语法错误。
To put it simply, don't use LIKE
and =
together. Use one or the other. I guess you mean LIKE
in this case, so remove the =
and your query will work.
简单地说,不要一起使用LIKE和=。使用其中一个。我想你的意思是LIKE在这种情况下,所以删除=,你的查询将工作。
#3
0
In your query you don't write = operator or LIKE keyword at a same time
在查询中,您不会同时写入=运算符或LIKE关键字
- If you want to use LIKE keyword then follow the below query
如果要使用LIKE关键字,请按照以下查询
SELECT * FROM `users` WHERE `name` LIKE "%شريف%"
- If you want to use = operator then follow the below query
如果要使用=运算符,请按照以下查询
SELECT * FROM `users` WHERE `name` = "شريف"
#4
0
Try the following command for searching Arabic data use:
尝试以下命令搜索阿拉伯数据使用:
SELECT * FROM `users` WHERE MATCH(`name`) AGAINST('شريف' in Boolean Mode);