Jump to content

Archived

This topic is now archived and is closed to further replies.

vickytam

showing record (page by page)

Recommended Posts

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

Share this post


Link to post
Share on other sites
[!--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.


Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.