jbingman Posted December 28, 2007 Share Posted December 28, 2007 I have a LIMIT on an SQL statement that forces the user to click next/previous if content runs longer than 15. however, we have a copyright bar at the bottom of the page that doesnt show up until the last page of content. Does any one know why? <?php // Determine startrow if (isset($_GET['startrow'])) { $startrow = $_GET['startrow']; } else { $startrow = 0; } $articlecount = "select id from main where section = '$section' and status != 'archive' and status != 'edit' AND status NOT LIKE '%f%'"; $articlequery = @mysql_query($articlecount,$db_conn) or die(mysql_error()); $articlenum = mysql_num_rows($articlequery); $listsql = "select id, monthname(date) as month, dayofmonth(date) as day, year(date) as year, section, date, title, writer from main where section = '$section' and status != 'archive' and status != 'edit' AND status NOT LIKE '%f%' order by date desc LIMIT $startrow, 15"; $listquery = @mysql_query($listsql,$db_conn) or die(mysql_error()); $listnum = mysql_num_rows($listquery); while ($listrow = mysql_fetch_array($listquery, MYSQL_NUM)) { $lid = $listrow[0]; $date = $listrow[1].' '.$listrow[2].', '.$listrow[3]; $section = $listrow[4]; $title = stripslashes($listrow[6]); $writer = stripslashes($listrow[7]); $listcont .= '<span class="regularindent"><a href="?page=articles&id='.$lid.'">'.$title.'</a> - '.$writer.' ('.$date.')<br></span> '; } echo ' <div id="sectionlistwrapper"> Additional '.$section.' articles:<br> <br> '.$listcont; if ($articlenum > 15) { echo ' <span class="addlink">'; if ($startrow >= 15) { echo '<a href="?page=section§ion='.$section.'&startrow='.($startrow-15).'">< - previous</a> |'; } else { echo '<span class="disabled">< - previous </span>|'; } if ($startrow+15 < $articlenum && $articlenum > 15) { echo ' <a href="?page=section§ion='.$section.'&startrow='.($startrow+15).'"> next - ></a>'; } else { echo '<span class="disabled"> next - ></span>'; } echo '</span> '; } echo "</div> "; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/83509-solved-list-limit-causing-problems/ Share on other sites More sharing options...
revraz Posted December 28, 2007 Share Posted December 28, 2007 Which line displays the footer? Quote Link to comment https://forums.phpfreaks.com/topic/83509-solved-list-limit-causing-problems/#findComment-424873 Share on other sites More sharing options...
jbingman Posted December 28, 2007 Author Share Posted December 28, 2007 nevermind we solved it. our copyright bar had a top element in the css which shouldnt have been there. it was causing it to disappear off the screen with 15 content lines. Thanks anyways! Quote Link to comment https://forums.phpfreaks.com/topic/83509-solved-list-limit-causing-problems/#findComment-424880 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.