vickytam Posted April 12, 2006 Share Posted April 12, 2006 Dear all,I wrote some code as below:<?php…… (Connected to database & get 1000 records from database (using array function)$date = $row['date'];$product = $row['product']; ?><table border="1"><tr><td><?php echo $date; ?></td><td><?php echo $product; ?></td></tr></table>There are 1000 records were loaded via array function. How can I make a page break function?Each page will show 100 records only. Can anyone help?Thank you.Regards,Vicky Quote Link to comment https://forums.phpfreaks.com/topic/7170-showing-record-page-by-page/ Share on other sites More sharing options...
bonaparte Posted April 12, 2006 Share Posted April 12, 2006 [!--quoteo(post=363899:date=Apr 12 2006, 12:36 AM:name=Vicky)--][div class=\'quotetop\']QUOTE(Vicky @ Apr 12 2006, 12:36 AM) [snapback]363899[/snapback][/div][div class=\'quotemain\'][!--quotec--]Dear all,I wrote some code as below:<?php…… (Connected to database & get 1000 records from database (using array function)$date = $row['date'];$product = $row['product']; ?><table border="1"><tr><td><?php echo $date; ?></td><td><?php echo $product; ?></td></tr></table>There are 1000 records were loaded via array function. How can I make a page break function?Each page will show 100 records only. Can anyone help?Thank you.Regards,Vicky[/quote]Get the no. of rows affected with mysql_affected_rows(). Use limit in your queries to limit the no of rows fetching.For example,mysql_query("seelct * from <tablename> limit 25,10") fetches the rows from 25 to 35. Then pass the row number with a next button and execute the script. Quote Link to comment https://forums.phpfreaks.com/topic/7170-showing-record-page-by-page/#findComment-26093 Share on other sites More sharing options...
vickytam Posted April 12, 2006 Author Share Posted April 12, 2006 Thank you. Quote Link to comment https://forums.phpfreaks.com/topic/7170-showing-record-page-by-page/#findComment-26095 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.