22. oktober 2002 - 18:48Der er
4 kommentarer og 1 løsning
Fritekst søgning
Hey!
Jeg vil gerne at man kan sætte flere kriterier på min fritekst søgning.
Lige nu søger jeg sådan her : strSQL = "SELECT ID, titel, text, author, type FROM texts WHERE " strSQL = strSQL & " (titel LIKE '%" & strKeyword & "%')" strSQL = strSQL & " OR (text LIKE '%" & strKeyword & "%')" strSQL = strSQL & " OR (author LIKE '%" & strKeyword & "%')" strSQL = strSQL & " OR (type LIKE '%" & strKeyword & "%')"
Jeg vil gerne have søgningen begrænset til kun at søge på de typer i min tabel der hedder : type1, type2, type3.
Har forsøgt mig med følgenede:
strSQL = "SELECT ID, titel, text, author, type FROM texts WHERE type = 'type1' OR type = 'type2' OR type = 'type3' AND" strSQL = strSQL & " (titel LIKE '%" & strKeyword & "%')" strSQL = strSQL & " OR (text LIKE '%" & strKeyword & "%')" strSQL = strSQL & " OR (author LIKE '%" & strKeyword & "%')" strSQL = strSQL & " OR (type LIKE '%" & strKeyword & "%')"
strSQL = "SELECT ID, titel, text, author, type FROM texts WHERE type = ´('type1' OR type = 'type2' OR type = 'type3') AND" strSQL = strSQL & " (titel LIKE '%" & strKeyword & "%')" strSQL = strSQL & " OR (text LIKE '%" & strKeyword & "%')" strSQL = strSQL & " OR (author LIKE '%" & strKeyword & "%')" strSQL = strSQL & " OR (type LIKE '%" & strKeyword & "%')"
hvad med: strSQL = "SELECT ID, titel, text, author, type FROM texts WHERE (type = 'type1' OR type = 'type2' OR type = 'type3') AND (" strSQL = strSQL & " (titel LIKE '%" & strKeyword & "%')" strSQL = strSQL & " OR (text LIKE '%" & strKeyword & "%')" strSQL = strSQL & " OR (author LIKE '%" & strKeyword & "%')" strSQL = strSQL & " OR (type LIKE '%" & strKeyword & "%'))"
hehe, licens hmmmm jeg ville da gerne hvis jeg kunne nedsætte den licens jeg selv skal betale til tv+musik og alt det der....
meeeeen jeg tror nu jeg holder til det private ;-)
Synes godt om
Ny brugerNybegynder
Din løsning...
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.