Jump to content

showing record (page by page)


vickytam

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
Link to comment
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.


Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.