Hello all I tired to create Next page & Previous page but fail to work with out error in Attach Files you will see my code there are important query select * from `$table_02` where `ts_09`='$_GET[link_id]' Code (markup): $table_02 ----> in my DB news ts_09 --------> in my DB link_id number Thank's
first of all dont use gpc variables directly. $link_id= (get_magic_quotes_gpc()) ? $_link_id['link_id'] : addslashes($_link_id['link_id']); PHP: what is error message?
Display only 5 or 10 post and Next page empty or nothing I was use this code http://www.webmaster-talk.com/792581-post4.html Code (markup):
Don't put "ts_09" in parenthesis... Use select * from `$table_02` where ts_09='$_GET[link_id]' Instead of.. select * from `$table_02` where `ts_09`='$_GET[link_id]' What other errors are you getting?
I can but try it yourself first and post what you come up with and we can fix it from there.... The website that the pageination is on has tutorial videos that actually use it. I think the best one if the forum video 10 or 11 ... its the one dealing with replies
I've posted a whole simple pagination script somewhere else on the forum. Although it bears repeating, I don't want to be redundant so I'll just give you the gist of it. You will need some thing like this: <?php $page = $_GET['page']; // Define how you should know which results to display $perPage = 5; // 5 Results per page if(!isset($page) OR !is_numeric($page)){ $page = 1; // If page is not set or is set to a non-numeric character, default back to page 1 :) } $limit = $perPage*($page-1); // This is what we want to be our starting point for results. // MySQL Stuff mysql_connect("localhost","USER","PASS"); mysql_select_db("DATABASE_NAME"); // Run the query $query = mysql_query("SELECT * FROM prefix_table ORDER BY date DESC LIMIT ".$limit.", ".$perPage.";"); while($row = mysql_fetch_array($query)){ print "<h1>".$row['title']."</h1>".$row['post']."<br /><br />"; } mysql_close(); ?> PHP: Something simple like that should work. To make links all you would need to do is some simple while($link < $total){ print "<a href="$linkno">$linkno</a>"; $linkno++; $link++; } just for sake of a simple example. Regards, Dennis M.