tags:

views:

40

answers:

2

I do have thousands of urls in my database. what I want to do is display all urls in multiple pages say number of URLS per page is 100 and alphabetically then when ever a user search for a URL info it should get updated on relevant page. for example if it is google.com then it should get updated on "G" page and no duplicate entry. how can I do this with PHP and MySQL??

+2  A: 

You would need to combine a WHERE clause in your SQL with a LIMIT 0,100 or something.

You can use the where clause to limit it by letter WHERE name LIKE 'G%' and you can use the limit clause to get the first 100 rows by doing LIMIT 0,100

webdestroya
A: 

fist of all alphabetically ordered list:

SELECT url_column_name 
FROM my_table 
ORDER BY url_column_name ASC

what you wanna do is a pagination you can read about pagination here: http://hype-free.blogspot.com/2008/10/efficient-sql-pagination-method.html

holms