php,mysql,如何比较两个字符串?

i have 2 tables in 2 different databases: database1.table1 that looks like:

id | word1
1    test1
2    test2
3    test3

and database2.table2 that looks like:

price | word2
10      test1
15      test2
30      test3

how can i compare word1 and word2 to see if the keys from word2 are found in word1 in either a mysql join or php

any ideas? Thanks

SELECT t1.id, t1.word1, t2.price
  FROM database1.table1 t1 
  JOIN database2.table2 t2 
    ON t1.word1 = t2.word2;