Skip to content

Commit

Permalink
better query
Browse files Browse the repository at this point in the history
  • Loading branch information
Ysurac committed Nov 30, 2017
1 parent 003f436 commit 964a3c1
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions require/class.Marine.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
<?php
/**
* This class is part of FlightAirmap. It's used for marine data
*
* Copyright (c) Ycarus (Yannick Chabanois) <[email protected]>
* Licensed under AGPL license.
* For more information see: https://www.flightairmap.com/
*/
require_once(dirname(__FILE__).'/class.Image.php');
$global_marine_query = "SELECT marine_output.* FROM marine_output";

Expand Down Expand Up @@ -320,7 +327,7 @@ public function getMarineDataByIdent($ident = '', $limit = '', $sort = '', $filt
{
return false;
} else {
$additional_query = " AND (marine_output.ident = :ident)";
$additional_query = " AND marine_output.ident = :ident";
$query_values = array(':ident' => $ident);
}
}
Expand All @@ -347,7 +354,7 @@ public function getMarineDataByIdent($ident = '', $limit = '', $sort = '', $filt
$orderby_query = " ORDER BY marine_output.date DESC";
}

$query = $global_marine_query.$filter_query." marine_output.ident <> '' ".$additional_query." ".$orderby_query;
$query = $global_marine_query.$filter_query." ".$additional_query." ".$orderby_query;
//echo $query."\n";
$spotter_array = $this->getDataFromDB($query, $query_values, $limit_query);

Expand Down

0 comments on commit 964a3c1

Please sign in to comment.