|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Select text string
I have a database with an id column and a data column
I have a php enabled script that searches this binary data column (BLOB) for a string. So let's say: $string = "Fox jumped over fences"; This I know for certain would be found in 5 rows. I have this: It is not working, and I'm certain it is because of the spaces in the string? Because it will work with = as LIKE and string as '%$string%' or when i split up the string and make it just the words. Problem is, then it returns all the rows in the database with only Fox, and not the rest of the string. Any help would be appreaciated. thanks |
|
#3
|
|||
|
|||
|
RE: Select text string
Oh please.
I've read and read for two hours. I just want to know... can a binary blob field be searched with anything other then column LIKE "$string"? i'm so fusterated. |
|
#4
|
|||
|
|||
|
RE: Select text string
you must remember that when you are searching a field for a string using 'equal' (=), then the whole field would would need to match the string. If you need to find a string contained inside another string (a substring if you will), then you will need to use the LIKE statement with the wildcard characters
|
|
#5
|
|||
|
|||
|
RE: Select text string
Thanks.
That's just it though I want it to get the whole string, spaces and all. Which are stored in binary in a blob field (uploaded from a file). But it will only find it when they are broken up or it uses LIKE instead of =. Which is fine, but not always going to be a definite result. And it's not up to me to alter the database for fulltext searching. So I want it to be column = "$string"; But it's only excepting column LIKE "%$string%"; So I was trying to figure out if it had something to do with binary data altering what the spaces were. |
|
#6
|
|||
|
|||
|
RE: Select text string
is the column exactly that string and nothing else?
|
|
#7
|
|||
|
|||
|
RE: Select text string
No, the column will have a great deal more.
It could be an entire document consisting of pages and pages of text with only that string as one small sentance contained within (all converted to binary in the blob of course). It could be just that string, but it's unlikely. 99% chance that it contains more. |
|
#8
|
|||
|
|||
|
RE: Select text string
In that case, the only thing that would work would be a LIKE Statement and wildcards surrounding the string
|
|
#9
|
|||
|
|||
|
RE: Select text string
Ok Thanks!!!
LIKE it will be then. |
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Database Help > Select text string |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|