😕
This is the first something like this has happened... i must not be seeing somthing, or maybe i don't know how to add? What's going on here?
// Find out where to place this in the navigation
$sel_level = $data['hierarchy']; // outputs: 3
$cur_level = $data['cur_level']; // outputs: 6
echo "sel_level: " . $sel_level . "<br>";
echo "cur_level: " . $cur_level . "<br>";
// Update the new Navigation Order if necessary.
if($sel_level == $cur_level){
$new_level = $cur_level;
}else{
// Do the Math
$difference = $sel_level - $cur_level;
$new_level = $cur_level + $differnce;
echo "difference: " . $difference . "<br>"; // outputs: -3
echo "new_level: " . $new_level . "<br>"; // outputs (incorrectly): 6
//....
This is the part of my scrip that does some math...
Here is the out put I get...
sel_level: 3
cur_level: 6
difference: -3
new_level: 6
new_level should be outputing '3', in this senerio... but it's not.
In the other tests i have done i have found that $new_level always outputs the same as the $cur_level. When it should clearly output $cur_level + $difference
I've been wroking on this script since Noon so maybe i'm just blind to somthing... but i've looked over this code now for 30 min.
Can you see what's going wrong here? am I ignorant of somthing?
Thanks,
Phence