Jump to content

simple code inversion


calmchess

Recommended Posts

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;

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

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.

Archived

This topic is now archived and is closed to further replies.

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