dozpox8752 2018-03-28 17:22
浏览 43

php和mysql搜索用户

I wrote this code to search users from mysql :

$query = $db->query("SELECT * FROM `users` WHERE `id` = {$id} ");
while($row = $query->fetch_assoc()){
    echo $row['username'];
    // ....
    echo "People also search :";
    // the people also search box
}

I want it so that when the user pages load in the bottom of the page be a box like this:

Walter

...

People also search :

Bruce Kevin Jesse

something like the Google when you search actors or ...

how could I do this ?

  • 写回答

2条回答 默认 最新

  • dparivln22034 2018-03-28 17:28
    关注

    You'd need to keep a record of past searches and then when a new one is searched find all the people who searched for that in the past and find what else they searched for.

    评论

报告相同问题?