Home News Contact Us Forum About Us Demos Products F.A.Q.
Shopping Cart
You currently have 0 items in your cart.


Recent Events
  • 23/11/2024 Black Friday 2024

    BIG SALE, 30% discount for all our extensions. Use BF24 coupon code. Hurry up the discount is valid till 3 December.

  • 31/12/2023 New Year SALE

    We are glad to announce New Year SALE. 25% discount for all our extensions. Use NY24 coupon code. Hurry up the discount is valid till 7 January.


2Checkout.com, Inc. is an authorized retailer of goods and services provided by ARI Soft. 2CheckOut




Follow us on twitter



Welcome, Guest
Please Login or Register.    Lost Password?

Queary range of data in MySQL database?
(1 viewing) (1) Guest
Go to bottomPage: 1
TOPIC: Queary range of data in MySQL database?
#39500
Queary range of data in MySQL database? 11 Years, 7 Months ago Karma: 0
Hi

I have many sets of data using the same column structure and therefor easily are placed in the same table in my MySQL database. This makes upload, maintenance and editing much easier.

I would like to set up a set of modules, each getting a specific range of data from that table.

First module should display data from row 3 to 53, second module should display data from row 60 to 120 and so on.

In total I will have a very large table with more than 10.000 rows but I never want to display all of these, I just need the ranges. I want the data that is displayed on the site in each module to be sortable as usual of course.

Can you please explain how I need to set up the query to make this possible?

Best Regards
Johan Niklasson
The administrator has disabled public write access.
 
#39503
Re:Queary range of data in MySQL database? 11 Years, 7 Months ago Karma: 760
Hello,

Are row numbers stored in database?

Regards,
ARI Soft
The administrator has disabled public write access.
 
#39505
Re:Queary range of data in MySQL database? 11 Years, 7 Months ago Karma: 0
Hi

Yes, I will have it all set up so that row numbers are stored (or at least a field id number that would do the same thing). The data is static - it will not be updated very often so row numbers will always be the same.

Best Regards
Johan Niklasson
Last Edit: 2013/04/10 06:59 By Evopro.
The administrator has disabled public write access.
 
#39523
Re:Queary range of data in MySQL database? 11 Years, 7 Months ago Karma: 760
For example if row number is stored in "RowIndex" column, it is possible to use the following SQL query to show rows from 1 to 30:

SELECT
*
FROM
tbl
WHERE RowIndex BETWEEN 1 AND 30

Regards,
ARI Soft
The administrator has disabled public write access.
 
#39663
Re:Queary range of data in MySQL database? 11 Years, 7 Months ago Karma: 0
Hi

Thanks for that.

I have tried to use it and it looks like this:

SELECT top50_all.id,
top50_all.rank,
top50_all.result_in_pounds,
top50_all.result_in_kilos,
top50_all.x_bwt,
top50_all.name_yob,
top50_all.date,
top50_all.actual_weight_body_weight,
top50_all.note,
top50_all.location,
top50_all.federation
FROM top50_all.id WHERE RowIndex BETWEEN 3 AND 52
ORDER BY top50_all.rank ASC

But it does not work. Can you see anything immediately wrong with it?

Best Regards
Johan Niklasson
The administrator has disabled public write access.
 
#39671
Re:Queary range of data in MySQL database? 11 Years, 7 Months ago Karma: 760
Hello,

"RowIndex" in our previous post was a sample name, use column name which contains row index in your table.

Use also "FROM top50_all" instead of "FROM top50_all.id".

Regards,
ARI Soft
The administrator has disabled public write access.
 
Go to topPage: 1