Jump to content

Recommended Posts

If I understand correctly, you will need to select an ID of the row you want to display.

 

So, for example, if you want to display row number 3 (out of 10). You will need to do a query like

 

$sql = mysql_query("SELECT * FROM tblName WHRE id = '3'") or die (mysql_error());

 

This peace of code would display a row where ID = 3 (so, if prepared like I assume, it would be a row number 3).

 

But, again, it's hard to understand what are you asking for.

i mean if i had 10 rows for example and i wanna make some type of pagination by reading the first five and by cliking next read the last , so how can i stop at the fifth one ,

 

i want some thing to get me the row number to know that i reached the fifth.

mysql pagination is used with LIMIT, eg:

 

SELECT * FROM `table` LIMIT 0,15;

SELECT * FROM `table` LIMIT 15,15;

SELECT * FROM `table` LIMIT 30,15;

 

where the first number is the row OFFSET, eg how many rows to SKIP.

the second number is the MAX ROWS, how many rows it can count to until it stops.

 

hope this helps,

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.