Jump to content

Recommended Posts

i cant give you the full detail but your talking with sql paging

 

and it work by pasing the value in the url like

?page=2

$x=$_GET['page']*10;//= 20 right? use this as the max value

$y=$_GET['page']-1*10;//= 10 right? then use this as the min value

 

then do something in your sql statement like

 

select * from table limit $x,$y

 

edited.......

dont use it exactly use this as prototype only there are lots of code in the net

 

new problem, this is giving me syntax error. The variables are right, $page == 0. $by == pid. i want it to display 1-25 and i just gives error:

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/.marja/msword/draftx.net/test/displaytable.php on line 54

 

if ($sort == "asc")
    {
    $result = mysql_query("SELECT pid, name,location, quest, membonly FROM pdatabase LIMIT '$page', 25
    ORDER BY " . $by);
    }
    ELSE
    {
    $result = mysql_query("SELECT pid, name,location, quest, membonly FROM pdatabase LIMIT '$page', 25
    ORDER BY " . $by . " DESC");
    }

technicly the error is when i'm displaying, but i know that works

while($row = mysql_fetch_array($result))

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.