高级搜索页面上的实时 MySQL 搜索结果
我是一名业余爱好者,去年九月开始学习 PHP,只是为了建立一个我一直希望和梦想另一个更有能力的人可以制作的业余爱好网站。
我喜欢编程,但我的空闲时间很少,并且喜欢广泛的其他兴趣和活动。
我觉得仅学习 PHP 就可以让我为我的网站创建 98% 的所需功能,但最后 2% 非常有吸引力:
该网站最强大的工具是一个高级搜索页面,可以从 1000 多个记录游戏中进行选择场景数据库。用户可以进行极其深入的数据挖掘——这个高级页面有超过 50 个不同的潜在变量。它的设计目的是允许铁杆用户搜索我们数据库中几乎任何可能的数据组合,并且效果很好。那些对浏览众多选项不感兴趣的人可以使用基本搜索,它由高级搜索中最受欢迎的部分组成。
由于高级搜索非常全面,并且数据库相当小(最大潜在命中数不到 1,200 个),因此您选择包含的每个变量获得任何合格结果的可能性都会急剧下降。
在我的幻想世界中,我可以像使用 Excalibur 一样使用 AJAX,当我的用户使用此页面时,他们的屏幕一角会有一个实时总结果
计数器,该计数器会自动更新其查询结构并报告添加每个变量后将显示多少个结果。通过这种方式,可以毫不费力地知道有多少变量就足够了,以及何时添加一个变量将结果集清零。
在 IBuyPower.com 上构建新的自定义计算机时,一个有点类似的实现(至少在视觉上)是 Subtotal
侧边栏
对于那些实际上仍在阅读本文的人,我的问题实际上相当简单:
考虑到时间&如上所述,我是否能够学习足够的 AJAX(或其他内容)来实现这一功能,而不会遇到太多麻烦?我是否能够或多或少地插入预先编写的代码片段并进行调整以适应?或者我应该考虑将我的代码开放给值得信赖的人吗?未来有能力执行此实施的个人吗? (假设我能找到一个......)
谢谢。
I'm a hobbyist, and started learning PHP last September solely to build a hobby website that I had always wished and dreamed another more competent person might make.
I enjoy programming, but I have little free time and enjoy a wide range of other interests and activities.
I feel learning PHP alone can probably allow me to create 98% of the desired features for my site, but that last 2% is awfully appealing:
The most powerful tool of the site is an advanced search page that picks through a 1000+ record game scenario database. Users can data-mine to tremendous depths - this advanced page has upwards of 50 different potential variables. It's designed to allow the hardcore user to search on almost any possible combination of data in our database and it works well. Those who aren't interested in wading through the sea of options may use the Basic Search, which is comprised of the most popular parts of the Advanced search.
Because the advanced search is so comprehensive, and because the database is rather small (less than 1,200 potential hits maximum), with each variable you choose to include the likelihood of getting any qualifying results at all drops dramatically.
In my fantasy land where I can wield AJAX as if it were Excalibur, my users would have a realtime Total Results
counter in the corner of their screen as they used this page, which would automatically update its query structure and report how many results will be displayed with the addition of each variable. In this way it would be effortless to know just how many variables are enough, and when you've gone and added one that zeroes out the results set.
A somewhat similar implementation, at least visually, would be the Subtotal
sidebar when building a new custom computer on IBuyPower.com
For those of you actually still reading this, my question is really rather simple:
Given the time & ability constraints outlined above, would I be able to learn just enough AJAX (or whatever) needed to pull this one feature off without too much trouble? would I be able to more or less drop-in a pre-written code snippet and tweak to fit? or should I consider opening my code up to a trusted & capable individual in the future for this implementation? (assuming I can find one...)
Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
对于初学者来说,这是一个很棒的项目。
首先我会说考虑使用像 jquery (jquery.com) 这样的库。它将简化其中的 javascript 部分,并且手册非常好。
您想要做的事情可以分为几个步骤:
高级搜索页面。
浏览器收集所有字段
值并将它们发送回
服务器。
使用值进行搜索并返回
结果数
浏览器收到的数量
结果并更新显示。
现在介绍实现细节:
这可能看起来需要理解很多,但您可以进一步分解每个步骤并一点一点地了解细节。
This is a great project for a beginner to tackle.
First I'd say look into using a library like jquery (jquery.com). It will simplify the javascript part of this and the manual is very good.
What you're looking to do can be broken down into a few steps:
advanced search page.
browser collects all the field
values and sends them back to the
server.
search with the values and returns
the number of results
browser receives the number of
results and updates the display.
Now for implementation details:
This may seem like a lot to take in but you can break each step down further and learn about the details bit by bit.
在不知道您的专业水平的情况下很难回答您的问题,但请查看 AJAX 的简短描述: http://blog.coderlab.us/rasmus-30-second-ajax-tutorial
如果这有意义,那么您的功能可能“无需太多麻烦”就可以实现。如果它看起来难以理解,那么可能不是。
Hard to answer your question without knowing your level of expertise, but check out this short description of AJAX: http://blog.coderlab.us/rasmus-30-second-ajax-tutorial
If this makes some sense then your feature may be within reach "without too much trouble". If it seems impenetrable, then probably not.