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.
我有 mysql 表“文件”。其中包含以下命令。1. id 2.filename 3.keywords
显示一个文件时,我想按最匹配的关键字显示来自同一数据库表顺序的相关文件。
应该是这样的
$keywords = $db->getkeywords('5'); //getting related files $sql = "select * from 'file's where 'keywords' like '$keywords'";
???
使用这样的东西:
$keywords = join(',' $db->getkeywords('5')); $sql = "SELECT * FROM files WHERE keywords IN ($keywords)";