Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MYSQL Reporting query ported #5

Open
GoogleCodeExporter opened this issue Nov 14, 2015 · 0 comments
Open

MYSQL Reporting query ported #5

GoogleCodeExporter opened this issue Nov 14, 2015 · 0 comments

Comments

@GoogleCodeExporter
Copy link

Issue:
The query in the reporting UI does not function for MySQL.

Solution (Patch):
Lines 56 - 72 of "report.php" can be replaced for MySQL with the following:

$sql = " 
  SELECT
    DATE_FORMAT(server_time, '%Y-%m-%d') STIME, 
    MEASUREMENT_CODE, 
    AVG(elapsed_time) ET_MEAN
  FROM 
    ".DBSCHEMA."MEASUREMENT_VIEW
  WHERE 
    server_time BETWEEN :startdate AND :enddate
  GROUP BY 
    DATE_FORMAT(server_time, '%Y-%m-%d'), 
    MEASUREMENT_CODE 
";

$sth = $dbh->prepare($sql);
$sth->bindParam(':startdate', $q_params['startdate'], PDO::PARAM_STR);
$sth->bindParam(':enddate', $q_params['enddate'], PDO::PARAM_STR);


Original issue reported on code.google.com by [email protected] on 27 Sep 2008 at 6:27

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant