i have a database full of rows of data.
i need an open source php search and pagination script.
so all i need to do is hook it up to the database, and results will be paginated. also the searching function optimized already....
Your question is so "freeform" so my answer is also. Take a look at the Zend Framework Pagintor and Search modules:
http://framework.zend.com/manual/en/zend.paginator.html
http://framework.zend.com/manual/en/zend.search.lucene.html
Paginator is very good and easy to use. Easy to integrate with somesort of caching and etc, but I have never really used search, so I cant comment on that.
Yii framework has exactly what you need. Take a look here:
http://www.yiiframework.com/doc/api/CPagination
Related
On my website I have quite a lot of pages that need to be paginated. I have solution for that, but it requires to put pagination function in each page. I searched for something flexible like having pagination function in one file (say pagination.php) and use it to paginate various data from database, so different mysql_queries and html output. But I was not able to find anything useful.
So could anyone please suggest php pagination function that would be flexible, so paginate data from different queries and outputs that are established on different pages.
There are several examples on the web to get you started, thats where I'd start:
http://www.phpclasses.org/search.html?words=pagination&x=0&y=0&go_search=1
http://www.phpsnaps.com/snaps/view/php-pagination-class/
http://www.phpbuilder.com/board/showthread.php?t=10283679
http://phpsense.com/2007/php-pagination-script/
Very good question. PHP frameworks like Zend or Joomla have their own solutions. If you don't use any PHP framework you will probably need to develop your own solution (your own library). Once I did it using javascript library "datatables", with my own server-side code. Examples on this can be found here in section "Server-side processing".
I have to use php,mysql to do a prroject.I have chosen to make a simple forum and use a lot of Ajax with it.since i am still a novice, can you guide me to a simple ajax guestbook which i can work on to make a forum? i want to end up with something like this but even simpler. http://board.fuzzylime.co.uk/
It's not terribly complex. Just set up a MySQL database, and use a PHP script to connect to it, check for a login, and add a record for a post or list records to view a post.
If you are just starting out, I would suggest that you first understand the basics of building a forum in PHP.
Personally I liked the forum example in this book . I thought it was explained very well. You can also just google for "PHP forum tutorial" to find a couple examples, like this one and this one.
Once you have the basic idea figured out you can start looking at how to make an AJAX style implementation. For that, you can also just google AJAX tutorials and go from there. Either way, I think if you are going to build a forum, its important to understand the basics behind building a forum before jumping into a more complicated example like an AJAX driven one. Understanding the PHP portion of the application, and the database behind the whole thing is a very important step.
I recently started working with CakePHP but there are a few things I don't understand...
What do I have to do to get an overview of a couple of functions/views on one page like 'www.example.com/profile'. I really need help with this I am stuck in thinking in regular procedural php.
First off, you should follow the Blog tutorial on the CakePHP cook book : http://book.cakephp.org/view/1528/Blog
It's a great example and walks you through all the main stuff.
CakePHP follows an MVC structure and maps the URLs to controller/actions (using routes)
In your example www.example.com/profile, if you haven't changed the default routing, actually maps to the index method in your ProfileController. This method uses the view in /views/profiles/index.ctp to display output.
First follow the tutorial and read up on the CookBook to figure out what all this means. It's very easy to learn and they have some good documentation. Also check out code generation in CakePHP. It helps you create your apps faster (if used properly).
You need to read the manual about Routing. Also be familiar with basic Apache knowledge like mod_rewrite.
I'd like to learn PHP with a view to using CodeIgniter to make a few apps. Does this alter what or how I should approach PHP to start with?
I'm a designer with good front-end skills. I used Coldfusion in University but want to build stuff in a language more widely supported (and respected?). CodeIgniter seems great but I'd like to know how good a grounding in PHP I'll need. Any tutorial/book suggestions much appreciated.
Here' s a post from Derek Allard about learning php with codeigniter (it's short, only a couple paragraphs):
http://www.derekallard.com/blog/post/learning-php-with-codeigniter/
yes there is one major thing you need to learn or understand first. It's the MVC model that codeigniter uses, it stands for Model, view & controller. Basicly you need to split your code into 3 layers, the model is to query the database, the controller is also called the business logic layer, you will need to check if a query can be executed or not and finally the view which is the presentation layer, what the user will see. For the rest general php knwoledge is required for codeigniter.
Here are some articles about MVC structure:
http://net.tutsplus.com/tutorials/other/mvc-for-noobs/
http://net.tutsplus.com/tutorials/php/hvmc-an-introduction-and-application/
and here is a list of 15 video tutorials about codeigniter written by authors of nettuts:
http://net.tutsplus.com/tutorials/php/codeigniter-from-scratch-profiling-benchmarking-hooks/ (this is the last tutorial of the list but it's the only one that links to all other tutorials)
EDIT: OOP (object oriƫnted programming) is also something you might want to have a look at.
http://net.tutsplus.com/tutorials/php/oop-in-php/
My take: first learn PHP, then learn a framework like CI. Trust me, that is the correct order.
Can anyone help me with a good list of php site search engines. I am thinking of implementing a google site search, but I would rather not pay for that and I would rather have as much control as I can over it.
Read through Roll your own Search Engine with Zend_Lucene.
The article is rather old though, so have a look at the ZF Reference Guide about Zend_Lucene too. Searching for Zend Lucene on Google should yield plenty useful results too.
Sphinx is pretty good, but it isn't written in PHP. It has got PHP libraries to interface with it though. You could also have a look at Zend_Search_Lucene from Zend Framework. Both of these make search indexes so you can do fast searches.
You can try the Zend Lucene implementation:
http://framework.zend.com/manual/en/zend.search.lucene.html
http://devzone.zend.com/article/91
You don't have to pay for Google Site Search and there's a small chance for much control means greater quality of results.
If your site is very specific you need to write you own code for search.
Sphinx is one of the best Open Source Search Engines. It has an excellent PHP API. Has very good community and forum too. PHP API for Sphinx comes embedded with the tar/zip file that you will download and with ease it can be embedded on top of your database. Has great vertical search capabilities. Its pretty simple to implement, try it out.
Here is a new PHP Search engine script, that can be implemented in any website, it is made with PHP 5.4+, MySQL, and Ajax.
https://sourceforge.net/projects/site-search-engine-php-ajax/
It crawls and indexes automatically the site pages, similar to Sphider.
It can uses PDO or MySQLi for connecting to MySQL database.