I can’t put all of the previous code on here but i’ll try to be more complete in my explanation.
Selecting a single row from the database based on user selections.
Within the single row there is a column named DSC1_Movement that we want to know what the value is.
This value can be 83 different things. For this example it will = Pullups
Then these values are received from a desperate pull:
[php]$heightcalc = $rowpcaf[‘height_inches’];
$weightcalc = $rowpcaf[‘weight_lbs’];
//length
$headandnecklength = $rowpcaf['head_and_neck'];
$torsolength = $rowpcaf['torso'];
$pelvislength = $rowpcaf['pelvis'];
$femurlength = $rowpcaf['femur'];
$tibialength = $rowpcaf['tibia'];
$ankletogroundlength = $rowpcaf['ankle_to_ground'];
$footlength = $rowpcaf['foot'];
$humeruslength = $rowpcaf['humerus'];
$forearmlength = $rowpcaf['forearm'];
$handlength = $rowpcaf['hand'];
//Component Weight (WPI * Length)
$headandneckcalc = 0; //need to translate this
$torsocalc = ($torsolength * 2.89861632);
$pelviscalc = ($pelvislength * 2.708574744);
$femurcalc = ($femurlength * 2.781898001);
$tibiacalc = ($tibialength * 1.063205488);
$ankletogroundcalc = 0;
$footcalc = ($footlength * .272112299);
$humeruscalc = ($humeruslength * .733138386);
$forearmcalc = ($forearmlength * .559867673);
$handcalc = ($handlength * .264867324);
Then I submit these statements
$pullupmovebwtwm = $weightcalc - $handcalc - $forearmcalc;
$pushupmovebwtwm = $weightcalc - $footcalc - $forearmcalc - $handcalc;
$situpmovebwtwm = $headandneckcalc + $torsocalc + $pelviscalc;
$squatmovebwtwm = $femurcalc + $pelviscalc + $torsocalc + $headandneckcalc + $humeruscalc + $forearmcalc + $handcalc;
//BW Total Weight Moved Part 2
$pullupmovebwtwm2 = 0;
$pushupmovebwtwm2 = 0;
$situpmovebwtwm2 = 0;
$squatmovebwtwm2 = 0;
//BW Distance Moved Part 1
$pullupmovebwdm = ($humeruslength + $forearmlength)/12;
$pushupmovebwdm =($humeruslength)/12;
$situpmovebwdm = (($headandnecklength + $torsolength)/12)/2;
$squatmovebwdm = ($femurlength)/12;
//BW Distance Moved Part 2
$pullupmovebwdm2 = 0;
$pushupmovebwdm2 = 0;
$situpmovebwdm2 = 0;
$squatmovebwdm2 = 0;
//Weight Distance Moved
$pullupmovewdm = ($humeruslength + $forearmlength)/12;
$pushupmovewdm = ($humeruslength)/12;
$situpwdm = (($headandnecklength + $torsolength)/12)/2;
$squatwdm = ($femurlength)/12;
//Total
$Pullupsmovefeetlbspr = ($pullupmovebwtwm * $pullupmovebwdm) + ($pullupmovebwtwm2 * $pullupmovebwdm2);
$pushupsmovefeetlbspr = ($pushupmovebwtwm * $pushupmovebwdm) + ($pushupmovebwtwm2 * $pushupmovebwdm2);
$situpsmovefeetlbspr = ($situpmovebwtwm * $situpmovebwdm) + ($situpmovebwtwm2 * $situpmovebwdm2);
$squatsmovefeetlbspr = ($squatmovebwtwm * $squatmovebwdm) + ($squatmovebwtwm2 * $squatmovebwdm2);[/php]
These only have 4 of the possible movements for testing purposes.
Then I want to submit this:
[php]$totalworkdoneftlbs1p = “$” . $row[‘DSC1_Movement’] . “movefeetlbspr”;
$totalworkdoneftlbs1 = $totalworkdoneftlbs1p * $row[‘DSC1_Reps’];
echo $totalworkdoneftlbs1;
[/php]
and have the echo be the calculation $Pullupsmovefeetlbspr.
Does that clarify what I am trying to do?