NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page [php] maths help

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.

Advanced Search


Reply
 
LinkBack Thread Tools
Old 07-02-2009, 05:53 AM THREAD STARTER               #1 (permalink)
The original NP Emo Kid
 
liam_d's Avatar
Join Date: Jan 2005
Location: Plymouth, UK
Posts: 1,693
liam_d is a name known to allliam_d is a name known to allliam_d is a name known to allliam_d is a name known to allliam_d is a name known to allliam_d is a name known to all
 




[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.
liam_d is offline   Reply With Quote
Old 07-02-2009, 09:33 AM   #2 (permalink)
Senior Member
 
nasaboy007's Avatar
Join Date: Jul 2005
Location: NJ
Posts: 1,219
nasaboy007 has much to be proud ofnasaboy007 has much to be proud ofnasaboy007 has much to be proud ofnasaboy007 has much to be proud ofnasaboy007 has much to be proud ofnasaboy007 has much to be proud ofnasaboy007 has much to be proud ofnasaboy007 has much to be proud ofnasaboy007 has much to be proud of
 



$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
nasaboy007 is offline   Reply With Quote
Reply


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

Liquid Web Smart Servers  
All times are GMT -7. The time now is 03:26 AM.

Managed Web Hosting by Liquid Web
Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger