Subject | about searching in a blob |
---|---|
Author | Yves Glodt |
Post date | 2003-07-28T19:08:23Z |
Hello,
I have this table in my php knowledgebase system:
CREATE TABLE "ADDRESS" (
"CATEGORY" INTEGER NOT NULL,
"NAME" VARCHAR(100) CHARACTER SET ISO8859_1 NOT NULL,
"KEYINDEX" INTEGER NOT NULL,
"ADDRESS" BLOB SUB_TYPE TEXT SEGMENT SIZE 100 CHARACTER SET
ISO8859_1,
"DATE_MODIFIED" VARCHAR(25) CHARACTER SET ISO8859_1,
"HOST_MODIFIED" VARCHAR(25) CHARACTER SET ISO8859_1,
"USER_MODIFIED" VARCHAR(100) CHARACTER SET ISO8859_1
);
and I have a search functionality which uses this query:
$sth = ibase_query("SELECT KEYINDEX,NAME,CATEGORY,DATE_MODIFIED FROM
ADDRESS WHERE UPPER(NAME) LIKE '%".strtoupper($_POST['crit'])."%' OR
ADDRESS LIKE '%".$_POST['crit']."%' ORDER BY 2 DESC");
I know the UPPER/strtoupper stuff for the varchar column is ugly but it
works. Well for the blob it doesn't, I cannot get (or fake...)
case-insensitivity with UPPER (I get string conversion errors)...
How could this be done? I use FirebirdSS-1.0.2.908-0 on RH9
regards,
Yves Glodt
--
Linux 2.4.21-0.13mdk #1 Fri Mar 14 15:08:06 EST 2003 i686
21:01:51 up 15 min, 1 user, load average: 0.03, 0.18, 0.16
I have this table in my php knowledgebase system:
CREATE TABLE "ADDRESS" (
"CATEGORY" INTEGER NOT NULL,
"NAME" VARCHAR(100) CHARACTER SET ISO8859_1 NOT NULL,
"KEYINDEX" INTEGER NOT NULL,
"ADDRESS" BLOB SUB_TYPE TEXT SEGMENT SIZE 100 CHARACTER SET
ISO8859_1,
"DATE_MODIFIED" VARCHAR(25) CHARACTER SET ISO8859_1,
"HOST_MODIFIED" VARCHAR(25) CHARACTER SET ISO8859_1,
"USER_MODIFIED" VARCHAR(100) CHARACTER SET ISO8859_1
);
and I have a search functionality which uses this query:
$sth = ibase_query("SELECT KEYINDEX,NAME,CATEGORY,DATE_MODIFIED FROM
ADDRESS WHERE UPPER(NAME) LIKE '%".strtoupper($_POST['crit'])."%' OR
ADDRESS LIKE '%".$_POST['crit']."%' ORDER BY 2 DESC");
I know the UPPER/strtoupper stuff for the varchar column is ugly but it
works. Well for the blob it doesn't, I cannot get (or fake...)
case-insensitivity with UPPER (I get string conversion errors)...
How could this be done? I use FirebirdSS-1.0.2.908-0 on RH9
regards,
Yves Glodt
--
Linux 2.4.21-0.13mdk #1 Fri Mar 14 15:08:06 EST 2003 i686
21:01:51 up 15 min, 1 user, load average: 0.03, 0.18, 0.16