| | |||||
| ||||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | THREAD STARTER #1 (permalink) |
| The original NP Emo Kid Join Date: Jan 2005 Location: Plymouth, UK
Posts: 1,693
![]() ![]() ![]() ![]() ![]() ![]() | [php] maths help Okay a new one for you, say i have a counter $this->post_count that which each post gets "++" to add 1 onto it, but then say i go to a second page i need to work out how many posts are before it and then add one to that. What would be the best way? For each page there are 7 posts. |
| | |
| | #2 (permalink) |
| Senior Member Join Date: Jul 2005 Location: NJ
Posts: 1,219
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | $page*7+$this->post_count++? i don't really understand your question. if you're trying to do it backwards, i think the modulus operator (%) may help - something like $page%7, and it'll give u the remainder when you divide the number of pages by 7. but i have no clue what your question really is so i cant help
__________________ Hacksar.com - Your source for random computer tips and tricks! MySiteMemberships.com - Keep track of your site registration information! Like my post? Rep is appreciated! |
| | |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| SQRT.info [abv for Square Root in Maths and IT] LLLL.info | PakSphere | Domains For Sale - Make Offer | 0 | 01-08-2008 05:37 PM |
| [php] logging visitors | Alex. | Programming | 6 | 12-31-2006 07:55 PM |
| Maths Question | kingfisher | The Break Room | 8 | 10-27-2005 01:19 PM |
| whos good at maths? | adam_uk | The Break Room | 5 | 05-16-2004 06:26 PM |