such as: I write keywords to the database, many times with the | separated, I extracted and then do related articles search, how can I extract the text separated from the Ah, so I use the keyword to do search AH
Reply:
Copy Code code as follows:
<script language= "VBScript" >
Dim keywords,operator,operend,strsql
keywords= "Clothing | lotus | Famous brand | china"
strSQL = "SELECT * FROM table_name where"
Operator= "title like '%"
operend= "%"
Keywords=join (Split (keywords, "|"), Operend & "OR" & operator)
document.write strSQL & operator & keywords & operend
</script>
Use of this query:
You can write multiple keywords when you add a data record, with the word "|" between the keyword and the keyword. Separated, of course, you can use other characters, so you need to modify the relevant code. Finally, according to the resulting SQL statement can query the relevant records