I would like to know if there is a fast way to get a row like this:
Name (Database comumn) would be a database like |ID|Name|Age|Gender|
Not in table:
Text (long string)
Names:
John Smith
Jack Stone
Brian Woods
Text: "Someone was going to go to John Smith but instead went to Brian Woods. Why would he do that to John Smith?"
And the query should return "John Smith" matches 2 times, "Brian Woods" matches 1 time
How do you get a thing that does this fast?
$text = "Someone was going to go to John Smith but instead went to Brian Woods. Why would he do that to John Smith?";
$query = $mysql("SELECT * FROM persons");
while($r = mysql_fetch_assoc($query))
{
if(preg_match("/".$r["Name"]."/", $text))
{
$matches[$r["name"]]+=1;
}
}
print_r($matches);