Jump to content
MakeWebGames

Displaying count


lucky3809

Recommended Posts

Cant find what im looking for in this forum maybe someone can help or direct me to a site that would help me out lol.

Iam trying to add the count of mail, that says something along the lines...

" Diplaying 1-10 mails of 20 in your mailbox."

I know how to get the 20 part that is total_items.

the part I cant seem to get is the 1-10 and how to calculate that for the next page to read

"Displaying 10-20 mails of 20 in your mailbox."

would this be something along the lines of the Selecting count query? or math as in $limit*$mail_id?

Link to comment
Share on other sites

Well if you have some form of pagination.. and your only displaying 10 messages you could do something like

<?php
$num1 = ($_GET['page'] == 1 OR !$_GET['page'] ? 1 : ($_GET['page']*10-10));
$num2 = ($_GET['page'] ? ($_GET['page']*10) : 10);
echo 'Viewing mail '.$num1.' to '.$num2;
?>

I honestly have no idea if this is going to work because I've been working with C++ for the past few days.. but I believe it should.

(And just incase.. it wont work if you just shove it in your script.. you need to modify it a bit.)

Link to comment
Share on other sites

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.   Paste as plain text instead

  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...