473,394 Members | 1,749 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Scroll Button Skips a Page of Six Rows Pulled from Database

I am a web design teacher a high school and need help with PHP. Our Staff Pages are on a carousel button. When pressed, it skips a page.

If you go to the Staff Page at http://www.cebyrd.com/staff.php and scroll, the scroll function reads 12 lines from the database instead of 6. So 6 teachers get skipped with every click of the car button. I don’t know why it’s skipping a page. Here’s my code:

Expand|Select|Wrap|Line Numbers
  1. <?php
  2.                 $row_ctr = 0;
  3.                 $open_LI = false;
  4.  
  5.                 while($row = $res->fetch_assoc()) {
  6.                   $row_ctr++;
  7.  
  8.           if($row_ctr % 3 == 1) {
  9.                     $open_LI = true;
  10. ?>
  11.                   <li>
  12. <?php     } ?>
  13.                     <div class="img_box">
  14.                       <figure><a href="<?=$row['URI'];?>"><img src="http://bytes.com/images/staff/<?=$row['imageURI'];?>" width="182" height="186" alt=""></a></figure>
  15.                       <div>
  16.                         <p><a href="<?=$row['URI'];?>"><span class="red_font"><?php printf("%s %s",$row['firstname'],$row['lastname']);?></span><br>
  17.                           <?=$row['title']?> - <?=$row['dept']?></a></p>
  18.                         <a href="mailto:<?=$row['email']?>"><?=$row['email']?></a><br>
  19.                                                 <?=$row['phone']?>
  20.                                       </div>
  21.                     </div>
  22. <?php
  23.                   if($row_ctr % 3 == 0) {
  24.                     $open_LI = false;
  25. ?>
  26.                   </li>
  27. <?php     } 
  28.                 }
  29.  
  30.                 if($open_LI) {
  31.                   $open_LI = false;
  32. ?>
  33.                   </li>
  34. <?php
  35.                 }
  36. ?>
Oct 31 '13 #1
2 1326
Luuk
1,047 Expert 1GB
The cause of this problem is the javascript used....

Also there's an error on your page:
Error Line 1428, Column 5: No p element in scope but a p end tag seen. </p>

But this is html, and not PHP ;)
Nov 9 '13 #2
Thank you so very much Luuk. I'm so lost and appreciate your help. I played around with the javascript and changed the "pageStep" from 3 to 2 and it's working perfectly. Thank you so very much for your help!

In gratitude,

Victoria Provenza
Nov 11 '13 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Andres Romero | last post by:
How can I scroll a web page in code? I need to send the user to a specific page location after a SelectedIndexChanged RadioButtonList event.
3
by: Everett | last post by:
I have a new Desktop Gateway PC with Windows XP Professional. Unfortunately, my scroll button does not work in any VB6 code. Does anyone know where and what driver I need, or is there another issue...
6
by: PD | last post by:
I have a parent .Net page (http://mywebsite/project.aspx) that has an iframe (http://iframe/iframe.aspx) which are on seperate domains. I need to adjust the scrolling on the parent window due the...
1
by: Chris | last post by:
Can anyone recomend the best way of disabling a button a page until it is fully loaded? Would it need to be done with Javacript?
1
by: sharadadutt1981 | last post by:
hi all, I was trying to fetch even or odd number rows from database. currently i am usying DB2 ver 8.0. any one can help me out.
20
idsanjeev
by: idsanjeev | last post by:
hello i want to modify multiple rows in database with select option i am using R.update but it can update only one record in database but i wants to more then one record is modify after submit so...
5
by: Scldb | last post by:
I'm designing a form and I want to deactivate the scroll button. Everytime someone uses the scroll button, it goes to either a new record or previous record. I don't want this capability. May I get...
5
by: vjayis | last post by:
Hi i hav a list of 20-30items from which another page is called in the same window., i need to display it in a fixed size such tht 10items are listed fixed and others are viewed by scrolling.,...
6
by: fikaqqq | last post by:
I need to be able to delete table rows from database via link which is shown down below, but i don't know how to form javascript function which will enable that. So, this is how my index.php looks...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.