MySQL Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsDatabasesMySQL Help

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 January 20th, 2013, 01:58 PM
josephman1988's Avatar
josephman1988 josephman1988 is offline
*Programmer In Training*
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2005
Location: SE London
Posts: 369 josephman1988 User rank is Corporal (100 - 500 Reputation Level)josephman1988 User rank is Corporal (100 - 500 Reputation Level)josephman1988 User rank is Corporal (100 - 500 Reputation Level)josephman1988 User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 1 Week 10 h 26 m 31 sec
Reputation Power: 11
Send a message via MSN to josephman1988
Facebook
Get last set of records without looping back to record 1

Hi Guys,

Hoepfully a quicky here!

I am working on a site, which requires a table to be screened, then every 10 records to be grabbed, and printed out to the screen.

However, it's the last 10 records I'm having problems with!

Basically I'm doing a simple LIMIT 0,10 - LIMIT 10,10 query and so on, but if I have a table that's 23 records populated, then on the 3rd repitition of the script (unfortunately at the moment it's 3 different querys, not being looped), we are printing the first 3 (rows 20,23), but also the next 7, from record 1 (1,7), I am totally confused, and would love some help, despite easy it might be!

Regards,
Joe.

Reply With Quote
  #2  
Old January 20th, 2013, 03:49 PM
r937's Avatar
r937 r937 is offline
SQL Consultant
Dev Shed God 43rd Plane (26000 - 26499 posts)
 
Join Date: Feb 2003
Location: Toronto Canada
Posts: 26,442 r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level) 
Time spent in forums: 3 Months 1 Week 2 Days 14 h 17 m 37 sec
Reputation Power: 4141
Quote:
Originally Posted by josephman1988
...we are printing the first 3 (rows 20,23), but also the next 7, from record 1 (1,7), I am totally confused
so am i

LIMIT doesn't work that way, so you're doing something wrong/different

i'd love to critique your code and/or query, but i can't see it from here
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesMySQL Help > Get last set of records without looping back to record 1

Developer Shed Advertisers and Affiliates



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 | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap