I've got the following two (sample) tables:
+----+-----------------+
| table_one |
+----+-----------------+
| id | name |
+----+-----------------+
| 1 | thisisavalue |
| 2 | this-is-a-value |
| 3 | thisis-avalue |
| 4 | this-isavalue |
| 5 | this-is-avalue |
| 6 | thisisa-value |
| 7 | thisis-a-value |
+----+-----------------+
+----+------------------------------------+
| table_one |
+----+------------------------------------+
| id | name |
+----+------------------------------------+
| 1 | thisisavalue andsomething-else |
| 2 | this-is-a-value and-somethingelse |
| 3 | thisis-avalue and-something-else |
| 4 | this-isavalue andsomething-else |
| 5 | this-is-avalue and-something-else |
| 6 | thisisa-value andsomething-else |
| 7 | thisis-a-value and-something-else |
+----+------------------------------------+
What I need to do is match the names from the second table with the ones in the first table. In the real tables the values are of course not all labeled 'this-is-a-value' and such.
The problem is that the values in table_one and table_two are never exactly the same. But they are pretty similiar. What I am looking for is a way, either in PHP or MySQL, to match these two values together.
As @Patrice requested, a better explanation on what I mean by pretty similar. I am having a collection with website names and titles.
One table has the value 'google.com' and the other one has the value 'Google.com - Search Engine'. I want to match these values together.