Tech Support Guy banner
Status
Not open for further replies.
1 - 3 of 3 Posts

·
Registered
Joined
·
21 Posts
Discussion Starter · #1 ·
hello.

I hv a database named lankavis_webs and there is a table named sl_hits. The fied are in the table like this,

id, song, artist, bitrate, dowload_url, views, downloads, lyrics, datetime.

There are about 1000 records in the data table.
I want to get output rows as last 25 record in 1.php and next 25-50 from last in 2.php and go ahead like it.
Already i have made fecth arry to display data . But i want to know how to select rows range like above.
Please help me.
 

·
Administrator
Joined
·
15,306 Posts
Look up using "LIMIT" inside your SELECT like this:

SELECT * from sl_hits LIMIT 1,25;

SELECT * from sl_hits LIMIT 26,25;

SELECT * from sl_hits LIMIT 51,25;

etc

Note that the second number (25) is the number of results to return and would be 25 in your example.

It would probably be easier to create a single .php file and set a variable to increase that number rather than make a bunch of php files... Good luck!
 

·
Registered
Joined
·
21 Posts
Discussion Starter · #3 ·
Look up using "LIMIT" inside your SELECT like this:

SELECT * from sl_hits LIMIT 1,25;

SELECT * from sl_hits LIMIT 26,25;

SELECT * from sl_hits LIMIT 51,25;

etc

Note that the second number (25) is the number of results to return and would be 25 in your example.

It would probably be easier to create a single .php file and set a variable to increase that number rather than make a bunch of php files... Good luck!
Thanx tech guy
I have understand it.
 
1 - 3 of 3 Posts
Status
Not open for further replies.
Top