Solved

How to manage pages and add search feature?

Posted on 2008-06-24
2
188 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:
Tchuki earned 250 total points
Comment Utility
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
Comment Utility

Nice link. Thank you so much.

0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
PHP question(s) about order of output 9 39
Button Click 11 23
resizeing PHP image 2 21
Codiing Non-Existent Links 4 21
Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
This article discusses four methods for overlaying images in a container on a web page
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…

772 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now