做一个图库,怎么做?
这就是我想要做的事情。让用户上传图像并将其显示在图库中。图库显示前 8 个拇指,共 2 行,每行 4 个,当您单击它时,用户会在 fancybox 中看到图像。但如何从数据库中获取正确的 8 张图像呢?我知道你可以 SELECT * FROM table limit number,number 但我不知道如何用 PHP 计算这些数字。有人可以帮我设置我的画廊吗?
This is the idea of what I want to do. Let the user upload an image and display it in the gallery. The gallery shows the first 8 thumbs, with 2 rows of 4, and when you click on it the users sees the image in a fancybox. But how can I get the right 8 images from my database? I know you can SELECT * FROM table limit number,number
But I don't know how to calculate those numbers with PHP. Can someone help me set up my gallery?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可能拥有有关用户当前所在页面的信息,例如 GET 参数“p”。
现在您可以简单地使用它来查找丢失的号码。第一个是 p*8,第二个是 p*8+8。这些将是您想要在当前页面上显示的图片。
You probably have information about the current page the user is on like as a GET parameter "p".
Now you can simply use that to find your missing numbers. The first one would be p*8 and the second one p*8+8. Those would be the pictures you want to display on the current page.