Skip to content

Instantly share code, notes, and snippets.

@everdaniel
Created August 6, 2013 23:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save everdaniel/6169674 to your computer and use it in GitHub Desktop.
Save everdaniel/6169674 to your computer and use it in GitHub Desktop.
baseline
<?php
//Pull historical daily; assumes that historical has at least as many years as the generated.
$sql = "select * from verde_historical_daily where year <= :year";
$core = Core::getInstance();
$stmt = $core->dbh->prepare($sql);
$stmt->bindParam(':year', $totalYears, PDO::PARAM_INT);
try {
$stmt->execute()
while($row = $stmt->fetch(PDO::FETCH_ASSOC)){
$historicalDailyYear[] = $row['year'];
$historicalDailyDay[] = $row['day'];
$historicalDailyFlow[] = $row['flow'];
}
}
catch (PDOException $e){
echo $e->getMessage();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment