var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: Find string occurrences
Hi, I need to do something with sql and I am not quite sure how to do it.
I have a variable string (urls), and I need to check if that string contains any of the keywords that are stored in a table.
For example, I have a table with the entries "keywordX1", "keywordX2", "keywordX3", etc.
Then I have a string such as "http://www.domainwithkeywordX2.com/path/?param=value
How can I quickly find if the url string contains (and which ones) keywords from the table using a sql query? (or any other fast method)
I can't select all the keywords and loop that because in the future the keywords list will be huge, and I need speed.
is there a table involved here?
usually SQL is written against tables, but the only table you mentioned is an unnamed table with a column called "entries" which has keywords in it
please do a SHOW CREATE TABLE for each table involved here
I currently have a table named targets with the columns ID int(11) (primary auto_increment), and keyword varchar(255).
I want to do a sql query and check if my string var (ex. google.com/?q=qwerty) contains any of the keywords in the targets.keyword table.
SELECT DISTINCT 'yes'
Originally Posted by r937
Thank you very much, it's 3.38am and I couldn't sleep thinking about how to do this, you saved me.