Pagination With PHP,MySql Db

rfhm

New Member
Pagination of MySQL Query Results i need this to have 5 results one one page and a link to page 2 witch has 5 more and so on and so forth the script is working i just need the Pagination and i will be set i dont know PDO or MYSqli "YET" so dont lecture me please ..i have tryed to inclued pagination parts from sites with turtoils and i have given up please help.. i will edit this with the correct one the way i need it once i figure it out with your help thank you in advance \[code\]<?php require "manybr.htm" ?><style><?php require "styles.css" ?></style><?php$host="XXXXX"; // Host name $username="XXXX"; // Mysql username $password="XXXXX"; // Mysql password $db_name="XXXX"; // Database name $tbl_name="tylted"; // Table name // Connect to server and select database.mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB");// select record from mysql $sql="SELECT * FROM $tbl_name order by id desc";$result=mysql_query($sql);?><table background='images/view.png' width='50%' align='center'><tr><th align='center'>Group</th><th align='center'>Submition By</th><th align='center'>Submition On</th><th align='center'>ScreenName</th><th align='center'>Password</th><th align='center'>Does This Work?</th><th align='center'>Vote</th></tr><tr><th align='center'><hr color='lime' width='100%'/></th><th align='center'><hr color='lime' width='100%'/></th><th align='center'><hr color='lime' width='100%'/></th><th align='center'><hr color='lime' width='100%'/></th><th align='center'><hr color='lime' width='100%'/></th><th align='center'><hr color='gold' width='100%'/></th><th align='center'><hr color='gold' width='100%'/></th></tr><?phpwhile($rows=mysql_fetch_array($result)){?><tr><td background='transparent' align='center'><b><a href="http://aol.cellufun.com/p/grp/grp.asp?v=??&grp=<? echo $rows['group']; ?>">{<? echo $rows ['group']; ?>}</a> </b></td><td background='transparent' align='center'><b><a href="http://aol.cellufun.com/p/player.asp?v=&p=<? echo $rows['yname']; ?>"><? echo $rows['yname']; ?><a> </b></td><td background='transparent' align='center'><b><? echo $rows['date']; ?></b></td><td background='transparent' align='center'><b><? echo $rows['username']; ?></b></td><td background='transparent' align='center'><b><? echo $rows['password']; ?></b></td><td background='transparent' align='center'><b><? echo $rows['works']; ?>% Yes <font color='transparent'>||||</font>&nbsp; <? echo $rows['dworks']; ?>% No</b></td><td background='transpatent' align='center'><b><a href='http://stackoverflow.com/questions/14063477/works.php?id=<? echo $rows['id']; ?>'><img src='http://stackoverflow.com/questions/14063477/images/ThumbsUp.png' height='30' width='30'></a>&nbsp;&nbsp;&nbsp;<a href='http://stackoverflow.com/questions/14063477/dworks.php?id=<? echo $rows['id']; ?>'><img src='http://stackoverflow.com/questions/14063477/images/ThumbsDown.png' height='30' width='30'></a></td> </tr><?php// close while loop }?><?php// close connection; mysql_close();?></table>\[/code\]
 
Back
Top