[英]how do I display list of URLS say maximum 50 per web page from MySQL database?
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. 我想做的是在多个页面中显示所有URL,说每页的URL数是100,并且按字母顺序排列,那么当用户搜索URL信息时,它应该在相关页面上进行更新。 for example if it is google.com then it should get updated on "G" page and no duplicate entry. 例如,如果它是google.com,则应该在“ G”页面上进行更新,并且没有重复的条目。 how can I do this with PHP and MySQL?? 我该如何使用PHP和MySQL?
You would need to combine a WHERE
clause in your SQL with a LIMIT 0,100
or something. 您将需要在SQL中将WHERE
子句与LIMIT 0,100
或其他东西组合。
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
您可以使用where子句按字母WHERE name LIKE 'G%'
来限制它,还可以使用limit子句通过LIMIT 0,100
获得前100行
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 您想做的是分页,您可以在这里阅读有关分页的信息: http : //hype-free.blogspot.com/2008/10/efficiency-sql-pagination-method.html
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.