Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Added brackets to the if statement
  • Loading branch information
sharonco-matrix authored and bradymiller committed Mar 15, 2016
1 parent 9436264 commit 048d70b
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions library/onotes.inc
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,22 @@ function getOnoteByDate ($date, $activity = "1", $cols = "*", $limit="all", $off
{
$sql = "select $cols from onotes where date like ? ";
array_push($sqlBindArray,"%".$date."%");
if ($activity != "all")
if ($activity != "all") {
$sql .= "and activity=? ";
array_push($sqlBindArray,$activity);
array_push($sqlBindArray,$activity);
}

$sql .= "order by date DESC";
}
else
{
$sql = "select $cols from onotes where date like ? ";
array_push($sqlBindArray,"%".$date."%");
if ($activity != "all")
if ($activity != "all") {
$sql .= "and activity =? ";
array_push($sqlBindArray,$activity);
array_push($sqlBindArray,$activity);
}

$sql .= "order by date DESC LIMIT ".escape_limit($offset).",".escape_limit($limit);
}

Expand Down

0 comments on commit 048d70b

Please sign in to comment.