|
| Register now to interact with over 11,000 members! Registered users have Posting Privileges, free access to Private Messaging, Email Notifications and more. |
|
|||||||
![]() |
|
|
Thread Tools |
|
|
#1 |
|
Join Date: Feb 2008
Location: Colombia
Posts: 118
Reputation: 32
|
search for string in a text column
hi, i want to make a search related with search tags, and those tags are all stored in the same column, as a text separated by commas. all tags are saved urlencoded, which means all weird chars are stored as %xx, where xx is a number. the only way i know to search for a substring in mysql so far is with 'like'; so i believe if i am gonna search for a series of tags, i have to include in my search something like 'or tags like tag1 or tags like tag 2' etc.
two questions: 1. is there any other way, besides 'like', to search for a pattern or substring in a string? 2. there is a problem with what i am doing so far, and i was not aware of that before: i save all tags as urlencoded because of security reasons, but the urlencoded uses '%' to save all weird chars.. but the % sign is also used as a apttern match in the like statement, so if i search for something like urlencoded('á'), which i have no idea how would it be but would output something like %xx, how do i search for the exact string '%xx' that represents the á in the database? tnx ____edit______ i just found out i can escape the % with a \, but anyway, is there any other way to search for a substring in mysql, so i do not have to use expressions? (which would be way slower than search for an exact string, in many rows) |
|
|
|
![]() |
| Thread Tools | |
|
|