I have two tables, one with adverts (two columns, 'keywords' & 'advert') and
the other with articles (one column, 'text')

How do I get them to match up selecting only one word from 'keywords' and
one from 'text'

i.e. Each 'keyword' record may have four or five words, say 'dog cat pet
bird'

+--------------------+-------------------------------------------+
¦     KEYWORDS       ¦          ADVERT                           ¦
+--------------------+-------------------------------------------+
¦ dog cat pet bird   ¦ come to the pet shop on the high street   ¦
+--------------------+-------------------------------------------+
¦ wine beer spirits  ¦  get your booze at Moe's!                 ¦
+--------------------+-------------------------------------------+

     Each 'text' record is an article, say 'My friend Ben has a dog'

+-----------------------------------------------------+
¦         TEXT                                        ¦
+-----------------------------------------------------+
¦ My friend Ben has a dog                             ¦
+-----------------------------------------------------+
¦ My friend Robert likes red wine                     ¦
+-----------------------------------------------------+
¦ My friend Shelley loves football                    ¦
+-----------------------------------------------------+

I understand that I can match the 'text' or the 'keyword' using a variable
to check against,

i.e. SELECT * FROM articles, adverts WHERE text LIKE '%dog%' AND keywords
LIKE '%dog%'

but I don't want to do that. I just want that, when I select an article from
the database, it'll pull up a related advert...

I haven't gone very far with this yet, so if it'd be more useful to
comma-delimit the keywords or something, then that's no problem.


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to