如何使用php和mysql为我的网站创建搜索引擎? [英] How to create a search engine for my website using php and mysql?

查看:110
本文介绍了如何使用php和mysql为我的网站创建搜索引擎?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用php和mysql创建了一个小型虚拟网站。基本上,在主页中,我的mysql数据库中的所有数据都被提取并显示给用户以及添加到购物车选项。现在,我想在页面顶部创建一个搜索选项卡,以便用户可以键入关键字,并从我的网站搜索详细信息并显示给用户。我怎样才能做到这一点?非常感谢任何链接或建议。我可以在网站上使用任何第三方引擎吗?我不打算在服务器中托管它。它只是一个我应该做的学校项目。

解决方案

是的,有一个第三方插件,由Google设计,以帮助您实现此功能,您可以使用此插件...但您可能遇到的唯一问题是您的网站的用户界面。无论如何,请尝试: https://www.google.com/cse/ [ ^ ],您还应该查看页脚链接,已经提供了此插件的所有资源。



其次,我从未在PHP和MySQL上做过任何工作但是,我可以给你一个关于你网站搜索引擎的建议。您可以看到,可以通过附加WHERE子句,使用LIKE命令并将搜索的关键字传递给它来生成搜索查询,MySQL将返回所有匹配的行。



MySQL字符串比较功能 [ ^ ]



最后,我想提供一些你可能会发现有用的资源,



http://www.webreference.com/programming/php/search/index.html [ ^ ]



http://mrbool.com/how-to-create-your-own-search-engine-with-php-and-mysql/25836 [ ^ ]



https://www.udemy.com/creating-a-search-engine-in-php/ [ ^ ]



关于CodeProject的文章:制作一个搜索引擎 [ ^

I have created a small dummy website using php and mysql. Basically, in the homepage all the data from my mysql database is fetched and shown to the user along with a add to cart option. Now, i want to create a search tab on the top of my page such that the user can type the keywords and the details are searched from my website and shown to the user. How can i do that? Any links or suggestion is very appreciated. Is there any third party engine that i can use for my website? I am not planning to host it in the server. Its just a school project which i have been given to do.

解决方案

Yes, there is a third-party plugin, designed by Google to assist you in this feature, you can use this plugin... but the only problem you might get across is the UI of your website. Anyways, try it at: https://www.google.com/cse/[^], you should also look in the footer links, all of the resources for this plugin are already given.

Secondly, I have never done any work in PHP and MySQL but yes, I can give you a suggestion for the search engine of your website. You see, the search queries can be generated by appending the WHERE clause, with a LIKE command and passing the "keyword" of your search to it, MySQL would return all of the rows that have a match.

MySQL string comparison functions[^]

Finally, I would like to provide a few resources that you might find helpfull,

http://www.webreference.com/programming/php/search/index.html[^]

http://mrbool.com/how-to-create-your-own-search-engine-with-php-and-mysql/25836[^]

https://www.udemy.com/creating-a-search-engine-in-php/[^]

Article on CodeProject: Making a Search Engine[^]


这篇关于如何使用php和mysql为我的网站创建搜索引擎?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆