Beginner Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOtherBeginner Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old July 10th, 2001, 05:54 PM
DocHolliday DocHolliday is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2001
Posts: 98 DocHolliday User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
Talking PHP/MySQL - simple questions

Hey everyone,
I webmaster a few sites online (some of you may be famliar with Aldera.net) and I'm working on another one now called Desktop Angels. I have created my MySQL database and worked on the front end PHP for a while..

You can see what I've done so far on this page: http://www.desktopangels.net/models.php

Now, all I've really done on this page is write a script that pulls wallpapers from the MySQL database and display them on the page the way I want - four rows of three wallpapers... next thing I am working on, and need help with, is how can I limit the number of wallpapers per page to 12, then display the next 12 on the next page, and so on... I don't understand how to do that.. I think it's a function in MySQL called LIMIT, yes? Something like that?

Basically, the website has five sections for wallpapers: Art, Angels, Models, Celelbrities, and Unknowns. ... in fact, I want to design it almost identically to desktopgirls.com (great site).

Can anyone help me with this 12 per page thing? I also want links on the page to the NEXT PAGE and PREVIOUS PAGE..

Thanks,
-Doc

Reply With Quote
  #2  
Old July 11th, 2001, 07:30 AM
DropKick DropKick is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2001
Location: UK
Posts: 2 DropKick User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to DropKick
You can limit the number of records in the result set with the LIMIT keyword - this keyword takes two parameters, which specify the row to start with and the number of rows to display. So the query
Code:
SELECT * FROM videos LIMIT 2,2

would return rows 3 and 4 from the result set.

Ps. Great site so far, i've bookmarked it

Reply With Quote
  #3  
Old July 11th, 2001, 12:28 PM
DocHolliday DocHolliday is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2001
Posts: 98 DocHolliday User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
oh ok.. so in the code LIMIT 2,2 means start at row two and display two rows? ... why then would it display rows 3 and 4 rather than rows 2 and 3?

Ok I have another question.. when I coded that page, I put somethign like SELECT * FROM models.. and I named the page models.php. Well, this way I can't use this page for the other sections (like celebrities, art, unknowns, etc..) How can I remove the "models" from 'SELECT * FROM models' so that this page can be used for all the other sections too?

If you don't understand what I mean, take a look at desktopgirls.com. (Great site!) They use a page called /list_thumbs.asp to display all their thumbnails... they use this page for all their categories (models, art, celebs, etc..) and there is a string in the url identifying which category you're looking at.. like: /list_thumbs.asp?categoryID=2

... so do I do something like this?

SELECT * FROM $category

and then identify $category in a string? Is that how this is done?

Thanks a lot for the help and for the comments on the site!

-Doc

Reply With Quote
Reply

Viewing: Dev Shed ForumsOtherBeginner Programming > PHP/MySQL - simple questions


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway