Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想要使用的是,我想每次从我的 LocationByCity 表中的 sqlite 数据库中选择城市当用户在搜索框中输入搜索词时,例如,如果用户输入 F 我想要所有从 F 开始的 CityNames,那么如何我这样做?
提前谢谢。
我必须检查一下,但我相信你想使用 LIKE 关键字。
语法类似于:
Select Fieldname From Tablename where fieldname LIKE ('%$myvar%');
其中 % 符号是通配符。
不确定 sqlite 是否具有全文索引,因此您应该注意,根据表中有多少行,它可能会变得非常慢。