Solved

How to manage pages and add search feature?

Posted on 2008-06-24
2
192 Views
Last Modified: 2013-12-12
Hello group,

I'm still learning PHP and have create a PHP page which allow users to upload a game (Flash base - *.swf). Of course, each game occupies a row in a table presenting its name, description and ....
it works fine but now I have run into a situation that adding these games will make long table.

1) How can I implement a code to take care of this situaiton? meaning that if number of uploaded files is more than 5 then show the rest of them in a 2nd page, 3rd page and so on. Like the way emails are shown and each user can get to Previous or Next page or using 1 2 3 4 ... n  links ?

2) Also, I need to allow user to search for a specific game name. Names are stored in a MySQL table and I have an idea but will be great if you could advise me on this thing too.

3) For the sorting, should I use only the sorting functions in PHP?

Regards.

0
Comment
Question by:akohan
2 Comments
 
LVL 14

Accepted Solution

by:
Vel Eous earned 250 total points
ID: 21862402
1) Pagination - http://www.tonymarston.net/php-mysql/pagination.html

2) Really depends on what criteria you are searching.  A very basic example would be:
    mysql_query ( "SELECT * FROM uploads WHERE title LIKE '%$var%'" );

3) Use a combination of PHP & MySQL to order your data.
0
 

Author Comment

by:akohan
ID: 21863125

Nice link. Thank you so much.

0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question