calmchess Posted January 12, 2010 Share Posted January 12, 2010 I need to invert this code so it does eveything oppisite .....could you pleas help me... i can't seem to wrap my mind around it $counter = 2; $totUsers0 = $counter0 - 4; $refNum0 = $counter0 / 4; $refNum1 = floor($refNum0); $totU = $totUsers0 + 1; $xCounter = $counter0+=1; Quote Link to comment https://forums.phpfreaks.com/topic/188250-simple-code-inversion/ Share on other sites More sharing options...
ignace Posted January 12, 2010 Share Posted January 12, 2010 You may want to explain what this code is supposed to do because as there are a few mistakes in your code: $counter0 does not exist also after you code has run your variables contain: $counter = 2; $totUsers0 = -2; $refNum0 = .5; $refNum1 = 0; $totU = -1; $xCounter = 3; So what should be the opposite? $counter = -2; $totUsers0 = 2; $refNum0 = -.5; $refNum1 = 0; $totU = 1; $xCounter = -3; Quote Link to comment https://forums.phpfreaks.com/topic/188250-simple-code-inversion/#findComment-993812 Share on other sites More sharing options...
mikesta707 Posted January 12, 2010 Share Posted January 12, 2010 what do you mean by opposite? as in reverse the order? $xCounter = $counter0+=1; $totU = $totUsers0 + 1; $refNum1 = floor($refNum0); $refNum0 = $counter0 / 4; $totUsers0 = $counter0 - 4; $counter = 2; but that doesn't really make sense (and will produce notices) Can you explain a little better what you want? Also explaining what this code does would help too Quote Link to comment https://forums.phpfreaks.com/topic/188250-simple-code-inversion/#findComment-993814 Share on other sites More sharing options...
calmchess Posted January 12, 2010 Author Share Posted January 12, 2010 i'm sorry what it does is it gets the current count of user that executes out of the database then it divides the current number of people by 4 so that i get 4 refrence numbers like ....1111....2222....3333 i need to take the refrence number and go in reverse to get what the current count would be if this were the current refrence number.....there a small amount of database stuff that i didn't include I just use some sudo data to accomplish it.....thanks for your time. Quote Link to comment https://forums.phpfreaks.com/topic/188250-simple-code-inversion/#findComment-993829 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.