14. januar 2004 - 23:34
Der er
3 kommentarer og 1 løsning
er der en bedre måde at lave denne her?
strGame = Trim(Request.QueryString("gid")) Set rs4 = Server.CreateObject("ADODB.RecordSet") strSQL = "SELECT * FROM cz_clans WHERE" strSQL = strSQL & " (game LIKE '%" & strGame & "%')" strSQL = strSQL & " OR (game1 LIKE '%" & strGame & "%')" strSQL = strSQL & " OR (game2 LIKE '%" & strGame & "%')" strSQL = strSQL & " OR (game3 LIKE '%" & strGame & "%')" rs4.Open strSQL, myConn, 1, 3 når jeg skriver etc. side.asp?gid=2 så får jeg også 20 med ud :( skal lige sige det skal køre på MySQL :) /Wall
Annonceindlæg fra Kingston Technology
14. januar 2004 - 23:36
#1
strGame = Trim(Request.QueryString("gid")) Set rs4 = Server.CreateObject("ADODB.RecordSet") strSQL = "SELECT * FROM cz_clans WHERE" strSQL = strSQL & " (game = '" & strGame & "')" strSQL = strSQL & " OR (game1 = '" & strGame & "')" strSQL = strSQL & " OR (game2 = '" & strGame & "')" strSQL = strSQL & " OR (game3 = '" & strGame & "')" rs4.Open strSQL, myConn, 1, 3 ???
14. januar 2004 - 23:37
#2
sådan her? - så søger du kun på hele ord: strSQL = "SELECT * FROM cz_clans WHERE" strSQL = strSQL & " (game LIKE '%" & strGame & "%')" strSQL = strSQL & " OR (game1 LIKE '% " & strGame & " %')" strSQL = strSQL & " OR (game2 LIKE '% " & strGame & " %')" strSQL = strSQL & " OR (game3 LIKE '% " & strGame & " %')"