0

我有一些 php 经验,但我一直在研究搜索功能,无法找到一种没有循环的方法来完成我的任务。

情况:有人会在表格中输入地址(例如 123 main st.)

我有一个包含街道名称的数据库(超过 200 个)

streetID - streetName
1        - Random Drive
2        - Curvy Crescent
3        - Main Street
4        - Station Main Lane
etc..

mysql是否有一个可以比较“123 main st”的内置函数?并返回街道 ID?

4

1 回答 1

0

Does PDO have a built in function

No. PDO is just a driver that sends your query to database and returns results back. It does no data manipulation of its own.

You have to use fulltext search feature of mysql, or some dedicated search engine like Sphinx.

于 2013-10-30T18:31:54.763 回答