Skip to content

Commit

Permalink
Fixed bug where total number of climbs was not correct
Browse files Browse the repository at this point in the history
  • Loading branch information
shimizust committed Sep 7, 2015
1 parent 5f5f4cc commit debc165
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion php_dataquery/getWorkoutData.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function getNumGyms($db,$userid) {

function getNumClimbs($db,$userid) {
//get number of climbs logged
$stmt = $db->prepare("SELECT COUNT(reps) FROM workout_segments INNER JOIN workouts ON workouts.workout_id = workout_segments.workout_id WHERE workouts.userid=:userid");
$stmt = $db->prepare("SELECT SUM(reps) FROM workout_segments INNER JOIN workouts ON workouts.workout_id = workout_segments.workout_id WHERE workouts.userid=:userid");
$stmt->execute(array(':userid'=>$userid));

$result = $stmt->fetch();
Expand Down

0 comments on commit debc165

Please sign in to comment.