Skip to main content
Inspiring
December 17, 2010
Answered

Recordset paging by A,B,C....instead of Next Page, Prev Page, etc.?

  • December 17, 2010
  • 1 reply
  • 6257 views

Hello geniuses,

I was wondering if there is a way to do the following:

I currently have a member database (MySQL) that I manage for a client. Using DW CS4, I used the built-in Recordset paging to add a navigation bar to the top of the member listing, limiting it to 50 per page. Since there are so many members in this organization, my client has asked me to create an A,B,C...navigation bar, rather than First Page - Next Page - Prev Page - Last Page. Is there a way to do this? Note that if a member is added or dropped from the list and they happen to be the first of the B's (for example), then the marker has to move accordingly. Thanks for pointing me in the right direction.

Regards,

Gail

This topic has been closed for replies.
Correct answer Günter_Schenk

First, you were correct about the missing single quotes, and that solved

the problem. Thanks very much.

So, a feature it is! I guess there's no real harm done to load more at

the "first look" of the member list. It does work correctly for all

letters. You are right in that if I drop "maxusers" down to 10 or 20,

the bottom half of, say, the Bs, gets cut off.

I originally had the Recordset Paging Navigation Bar on my page, but my

client didn't like it because he had to page through and hunt for

members. Hence my determination to provide an A,B,C navigation for him,

which you have so kindly helped me with. I didn't think about using both

features - the paging navigation bar, plus the A,B,C navigation. That

would definitely solve the worry of someday going over 50 members in any

given letter and not noticing that the list is cut off. I'll add it back.

I want to thank you profusely for all your help on this. Not only have

you stuck with me, but your timely responses meant I could finish this

today. You are my new best friend!

Best regards,

Gail


Gail,

it´s been a real pleasure to participate in such an intense "dialogue", and I salute you for remaining persistent !

Cheers,

Günter

1 reply

December 17, 2010

By A,B,C... do you mean that clicking on A will only show memebers whose name starts with A or do you mean like 1,2,3...10 etc where clicking on 1 will show the first 50 people that were entered into the DB? Please specify.

You can find useful information by searching for:

(your unmentioned server side scripting language) pagination

Inspiring
December 17, 2010

I mean that clicking on A will only display those whose last names

start with A. Sorry for any confusion.

Gail

Inspiring
March 28, 2011

Hi Gail,

congratulations for getting the severe issues sorted out by now, and I´m very happy about this

I don't know if you need to see this, but my coding for the letters is as follows:

<div class="letters">
  <p>

  <a href="<?php echo $_SERVER["PHP_SELF"]; ?>?letter=a">A</a>
  <a href="<?php echo $_SERVER["PHP_SELF"]; ?>?letter=b">B</b>
  <a href="<?php echo $_SERVER["PHP_SELF"]; ?>?letter=c">C</c>
  <a href="<?php echo $_SERVER["PHP_SELF"]; ?>?letter=d">D</d>
  <a href="<?php echo $_SERVER["PHP_SELF"]; ?>?letter=e">E</e>
  <a href="<?php echo $_SERVER["PHP_SELF"]; ?>?letter=f">F</f>
  <a href="<?php echo $_SERVER["PHP_SELF"]; ?>?letter=g">G</g>
  <a href="<?php echo $_SERVER["PHP_SELF"]; ?>?letter=h">H</h>
  <a href="<?php echo $_SERVER["PHP_SELF"]; ?>?letter=i">I</i>
  <a href="<?php echo $_SERVER["PHP_SELF"]; ?>?letter=j">J</j>
  <a href="<?php echo $_SERVER["PHP_SELF"]; ?>?letter=k">K</k>
  <a href="<?php echo $_SERVER["PHP_SELF"]; ?>?letter=l">L</l>
  <a href="<?php echo $_SERVER["PHP_SELF"]; ?>?letter=m">M</m>
  <a href="<?php echo $_SERVER["PHP_SELF"]; ?>?letter=n">N</n>
  <a href="<?php echo $_SERVER["PHP_SELF"]; ?>?letter=o">O</o>
  <a href="<?php echo $_SERVER["PHP_SELF"]; ?>?letter=p">P</p>
  <a href="<?php echo $_SERVER["PHP_SELF"]; ?>?letter=q">Q</q>
  <a href="<?php echo $_SERVER["PHP_SELF"]; ?>?letter=r">R</r>
  <a href="<?php echo $_SERVER["PHP_SELF"]; ?>?letter=s">S</s>
  <a href="<?php echo $_SERVER["PHP_SELF"]; ?>?letter=t">T</t>
  <a href="<?php echo $_SERVER["PHP_SELF"]; ?>?letter=u">U</u>
  <a href="<?php echo $_SERVER["PHP_SELF"]; ?>?letter=v">V</v>
  <a href="<?php echo $_SERVER["PHP_SELF"]; ?>?letter=w">W</w>
  <a href="<?php echo $_SERVER["PHP_SELF"]; ?>?letter=x">X</x>
  <a href="<?php echo $_SERVER["PHP_SELF"]; ?>?letter=y">Y</y>
  <a href="<?php echo $_SERVER["PHP_SELF"]; ?>?letter=z">Z</z>
  </p>
</div>

Well, these are meant to be HTML hyperlinks which all require the same closing tag: </a>


OK, now I've really embarrassed myself! I knew that! Don't know what I

was thinking.

Only two niggling issues remain. 1) still getting the first 50 members

after loading the page. I tried to delete the lines with "maxusers" in

them, but then it really got mad at me. This only happens the first time

the page loads; if I click on A again, I get only the As. My concern

with the 50 limitation on the pages is that there may be some letters of

the alphabet that have more than 50 members, and it will cut them off on

the bottom. Do you know how I can get rid of that limitation and all

lines that refer to it?

2) Still getting the error "Notice: Use of undefined constant letter -

assumed 'letter' in C:\wamp\www\2010 new site\list_users_abc_test.php

on line *46". *As I mentioned before, line 46 has: *$whereclause = " AND

lastname LIKE '".$_GET[letter]."%'";* The alphabetical links work, but

the error message remains. Any ideas?

Gail