Jump to content
MakeWebGames

Member-list


mikemastah

Recommended Posts

I'm looking for a way to divide my member list into pages 25 users each (Pages: 1 2 3 4 5....)

I've been studying mccodes (V1) to see how they do this but I just don't get it.

I also did a search on google, I read you need a for-loop but I'm not really good with for-loops either.....

If someone could point me in the right direction, that would be awesome.

Link to comment
Share on other sites

Re: Member-list

Pagination is the name most people give that sort of thing. It doesn't necessarily require a loop per say.

If you retrieve all records, you will have to loop through a segment of them instead of the whole thing. Since you're probably getting the data from the db, you're most likely already doing a loop anyways.

Where the pagination comes in is not going through the entire record set.

You could get part of the record set by putting a limit clause on your query. It's not the easiest thing to do though when you haven't done one before.

There are API's out there specifically for pagination though. ;)

Link to comment
Share on other sites

Re: Member-list

Thats what i was saying was use limit.....

I didn't say you was using mccodes...you did....or at least mentioned it so i though you was.

$sql_1 = mysql_query("SELECT username FROM users LIMIT 25");

$sql_2 = mysql_query("SELECT username FROM users LIMIT 25,25");

Maybe something along that lines.

Link to comment
Share on other sites

Re: Member-list

 

i made a mistake i get it. The first number is the start and the second number is how many records to get, i thought it was between the numbers.

as of "intervals" sql does have specific calls for those

"BETWEEN" or even interval() just in case you need to use them ;)

Link to comment
Share on other sites

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.   Paste as plain text instead

  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...