コード例 #1
0
ファイル: sql.php プロジェクト: rafaelbeckel/task-taste
 /**
  * Return plot data for the progress tracking plot, ordered by
  * date in ascending order.
  */
 public static function get_plot_data($project_id)
 {
     $data_points = NULL;
     $query = new SqlQuery("SELECT remaining_date, remaining_size FROM Remaining WHERE remaining_projectid='%s' ORDER BY remaining_date ASC", $project_id);
     if ($query->select_was_successful()) {
         $data_points = array();
     }
     while ($row = $query->get_next_row()) {
         $data_points[] = new DataPoint(strtotime($row['remaining_date']), $row['remaining_size']);
     }
     return $data_points;
 }