Solved

With a master - detail list of db values spanning 3 pages, how do I stop the list defaulting back to page 1 after a value has been selected?

Posted on 2007-11-27
5
214 Views
Last Modified: 2013-12-12
Okay - very unclear question title. Sorry. I'll try to explain.

Basically I have a master - detail type page which is drawing information from a MySql database. On the right hand pane of my webpage are a list of names of teachers (master). Clicking on these names reveals more information on these teachers (details) in the left hand pane of the website.

There are 20 teachers listed in the list of teachers on the right hand side pane. Clicking on the arrows at the bottom of the pande, reveals the next 20 teachers in the database, and so on.

The problem is that if I am viewing the second page of teachers (i.e - not the first 20, but the next 20) and I click on one of the teacher names to see more information, the information is displayed BUT the list refreshes back to the first 20 which were on the list.

Essentially, when I click on a teacher name to view details, how can I stop the page from going back to display the first 20 (or whatever value I specified) in the DB.

An example of this problem can be viewed at:
http://www.privatelesson.co.uk/TeacherProfile.php?teachertype=&location=&recordID=7299

If you press the arrow button at the bottom if this screen, it will take you on the next list of teachers and if you select one of these, the list refreshes to display the first 20 in the db.

Many thanks for reading this.
0
Comment
Question by:ayounis
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 11

Expert Comment

by:AlexanderR
ID: 20361880
It should really be in an iframe of some kind so it stays the same and does not waist resources when you click around.
But as a quick fix, around each name in the list you need to have something like


echo '<a href=http://www.privatelesson.co.uk/TeacherProfile.php?teachertype=&location=&recordID=7267&pageNum_m='.$_GET['pageNum_m'];
basically put &pageNum_m='.$_GET['pageNum_m'] at each link in the list

Open in new window

0
 

Author Comment

by:ayounis
ID: 20387956
Thanks AlexanderR.
Sorry about the late response to your solution. I can't really code, and am having some problems implementing your solution. The line of code which I guess you are referring to is this one:

<a href="MemberProfiles/MmNewMemberTeacherProfile0.php?&language=<?php echo $_GET['language'] ?>&prefecture=<?php echo $_GET['prefecture'] ?>&recordID=<?php echo $row_m['autonumber']; ?>" class="style45"><font size="1" face="Arial, Helvetica, sans-serif"><?php echo $row_m['firstname']; ?>

And the link to the details is on the 'firstname' link.

Where should I put the '&pageNum_m='.$_GET['pageNum_m']' link on this line?

Thanks
0
 
LVL 11

Expert Comment

by:AlexanderR
ID: 20388973
I hope we are talking about the same links here.  On the link that you provided, each teacher record has links similar to http://www.privatelesson.co.uk/TeacherProfile.php?teachertype=&location=&recordID=7233 not the kind in your latest post.

But if they both share the same pageNum technique it doesn't matter.  You should modify the links in your code to look like
<a href="MemberProfiles/MmNewMemberTeacherProfile0.php?pageNum_m='.$_GET['pageNum_m'].'&language=<?php echo $_GET['language'] ?>&prefecture=<?php echo $_GET['prefecture'] ?>&recordID=<?php echo $row_m['autonumber']; ?>" class="style45"><font size="1" face="Arial, Helvetica, sans-serif"><?php echo $row_m['firstname']; ?>

Open in new window

0
 
LVL 11

Accepted Solution

by:
AlexanderR earned 100 total points
ID: 20388977
sorry
<a href="MemberProfiles/MmNewMemberTeacherProfile0.php?pageNum_m=<?php echo $_GET['pageNum_m']; ?>&language=<?php echo $_GET['language'] ?>&prefecture=<?php echo $_GET['prefecture'] ?>&recordID=<?php echo $row_m['autonumber']; ?>" class="style45"><font size="1" face="Arial, Helvetica, sans-serif"><?php echo $row_m['firstname']; ?>

Open in new window

0
 

Author Comment

by:ayounis
ID: 20391097
That's perfect AlexanderR. Works a treat.

Many thanks.

0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question