Sponsored Content
Top Forums Web Development How to compute previous and next buttons? Post 302455075 by JerryHone on Monday 20th of September 2010 06:31:15 PM
Old 09-20-2010
How to compute previous and next buttons?

I have a project to migrate my club's membership database from Access to web based using MySQL/PHP, but I have a problem I can't get my head around and would appreciate some help...
Background...
I want to be able to display each member's data on screen and add a Previous and Next button to move the display to the next member in the list, with an order based on member's LastName, FirstName (and some other fields).
Creating the order to display is easy..
Code:
select MemberId
from Member 
order by LastName, FirstName, Title, MemberId

and then I can display a specific record with
Code:
select * from Member where MemberId=<...>

...but how do I determine the member ID for the next record when I'm displaying one record. So, if I'm, say, 30 records in, how do I know the Member ID of the 29th (previous) and 31st (next) record.

To clarify, let's assume that the sorted MemberId order is
Code:
17
25
8
42
40
...

Assuming I'm displaying the values of ID=8 on the page, what do I need to compute to enter 25 in the previous button and 42 in the next?

Hope that's clear.
 

4 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

replace buttons with hyperlinks

I have a script that uploads file push buttons, but i want to replace buttons with hyperlinks. Please send suggessions Thanks (1 Reply)
Discussion started by: handshakeit
1 Replies

2. UNIX Desktop Questions & Answers

Buttons and menues like win95

I'v got some question about x managers. I'm using FreeBSD7 + Gnome + fluxbox. when i'm trying to apply some themes, it doesn't look like it should be. All my buttons and menus are look like win95). Whaat kind of lib i should install... what should i do? Here is two printscreens. For ex. My... (1 Reply)
Discussion started by: Levenson
1 Replies

3. Web Development

buttons links in frame

Happy X-Mas to all members... Hi, I have one html file page1.html as below <HTML> <HEAD> <TITLE>Utilities</TITLE> </HEAD> <FRAMESET ROWS="5%,95%"> <FRAME SRC="frames1.html" NAME=SIDEBAR> <FRAME SRC="frames2.html" NAME=SAMPLE> </FRAMESET> </HTML> ... (0 Replies)
Discussion started by: villain41
0 Replies

4. Shell Programming and Scripting

Remove previous line if next & previous lines have same 4th character.

I want to remove commands having no output. In below text file. bash-3.2$ cat abc_do_it.txt grpg10so>show trunk group all status grpg11so>show trunk group all status grpg12so>show trunk group all status GCPKNYAIGT73IMO 1440 1345 0 0 94 0 0 INSERVICE 93% 0%... (4 Replies)
Discussion started by: Raza Ali
4 Replies
mysql(1)							  MySQL database							  mysql(1)

NAME
mysql_fix_privilege_tables - Fixes MySQL privilege tables. SYNOPSIS
mysql_fix_privilege_tables [mysql_root_password] DESCRIPTION
This scripts updates the mysql.user, mysql.db, mysql.host and the mysql.func tables to MySQL 3.22.14 and above. This is needed if you want to use the new GRANT functions, CREATE AGGREGATE FUNCTION or want to use the more secure passwords in 3.23 If you get 'Access denied' errors, run the script again and give the MySQL root user password as an argument. SEE ALSO
isamchk(1), isamlog(1), mysql(1), mysqlaccess(1), mysqladmin(1), mysqld(1), mysqld_multi(1), mysqld_safe(1), mysqldump(1), mysqlshow(1), mysql_zap(1), perror(1), replace(1) For more information please refer to the MySQL reference manual, which may already be installed locally and which is also available online at http://www.mysql.com/doc/en/ BUGS
Please refer to http://bugs.mysql.com/ to report bugs. AUTHOR
This manpage was written by Christian Hammers <ch@debian.org>. MySQL is available at http://www.mysql.com/. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +--------------------+------------------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +--------------------+------------------------------------+ |Availability | SUNWmysqlr, SUNWmysqlu, SUNWmysqlt | +--------------------+------------------------------------+ |Interface Stability | External | +--------------------+------------------------------------+ NOTES
Source for mysql is available on http://opensolaris.org. MySQL 4.0 17 March 2003 mysql(1)
All times are GMT -4. The time now is 11:00 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy