SELECT id, absolute_tag, tag FROM c7_storage_tags
WHERE users_id = 1 
      AND LOWER(absolute_tag) LIKE LOWER('@#Pictures#zee\'s fav%')
This is not giving me the correct result, even thou i do have a row in my database with the corre开发者_如何转开发ct string.
The better solution for me would be to figure out a way so that "@#Pictures#zee\'s fav" string of mine, could be treated as just a string. And I can perform like on it.
How can I fix it.
Thanks in advance.
Zeeshan
IF you string has a backslash in it, you should escape it twice :
// value absolute_tag == "@#Pictures#zee\'s fav"
select * from test where  `absolute_tag` like '@#Pictures#zee\\\\\'%'
From http://dev.mysql.com/doc/refman/5.0/en/string-comparison-functions.html#operator_like
Your query should look like
SELECT id, absolute_tag, tag FROM c7_storage_tags
WHERE users_id = 1 
AND LOWER(absolute_tag) LIKE LOWER('@#Pictures#zee\\\\\'s fav%')
Your original query was looking for a record with absoulte_tags begins with "@#Pictures#zee's fav"
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论